Sign in through GitHub

Please read for an updated status on RailsCasts:

Learn more or hide this

Sandeep Laxman's Profile

GitHub User: lsandeep83

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