fix recent_users error in users_widget.rb
[shapado:cantonics-shapado.git] / app / models / widgets / users_widget.rb
1 class UsersWidget < Widget
2   field :settings, :type => Hash, :default => { :limit => 5, :on_mainlist => true  }
3
4
5   def recent_users(group)
6     group.memberships.order_by(%W[created_at desc]).limit(self[:settings]['limit']).
7       paginate(:per_page => self[:settings]['limit'], :page => 1)
8   end
9
10   protected
11 end