RailsCasts Pro episodes are now free!

Learn more or hide this

Sandeep Laxman's Profile

GitHub User: FilterKaapi

Site: http://bookstreet.in

Comments by Sandeep Laxman

Avatar

Scoping is slightly different in rails 3.2 as shown below:

ruby
scope :with_role, -> { |role| { :conditions => "roles_mask & #{2**ROLES.index(role.to_s)} > 0" } }

Essentially, lambda is replaced by -> and named_scope by scope in rails 3.2