RubyFlow : The Ruby Community Blog

Home   Submit   Sign Up   Log In   leaders   Twitter   RSS Feed  
 

Monkey patch for CanCan 1.6.7 to replace MetaWhere with Squeel

Since MetaWhere is not compatible with Rails 3.1/3.2 and we are now directed to use Squeel instead, and I needed to use CanCan MetaWhere depending functionality, I made this gist that replaces MetaWhere with Squeel in CanCan 1.6.7 . Now one can write:

can :manage, User, :permissions.outer => {:type.matches => 'Manage%'}}

This fixes several issues. Happy coding!

Comments

Post a Comment

Note: If you are a registered user, you can log in to populate these fields.

You may use ONLY these HTML tags to format your comment:

<a href="" title=""> <b> <blockquote> <code> <em> <i> <strong>

Do NOT use <p> tags. Just use newlines :-)

s
u
p
p
r
W willy
e
T bum
s
s
M bum
n
M tits
e
w