RailsCasts Pro episodes are now free!
Learn more or hide this
GitHub User: FilterKaapi
Site: http://bookstreet.in
Scoping is slightly different in rails 3.2 as shown below:
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
lambda
->
named_scope
scope
Scoping is slightly different in rails 3.2 as shown below:
Essentially,
lambda
is replaced by->
andnamed_scope
byscope
in rails 3.2