Having a play with mongomapper and wanted to get Clearance working with it. Seemed to just be a simple case of doing the following in my user model.
1 2 |
def self.attr_accessible(*args)end include Clearance::User |
My full user model ended up looking like this:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
class User include MongoMapper::Document def self.attr_accessible(*args)end include Clearance::User key :email, String key :encrypted_password, String key :salt, String key :confirmation_token, String key :remember_token, String key :firstname, String key :email_confirmed, Boolean key :lastname, String timestamps! end |
Perhaps if I have time, I will look into adding attr_accessible support to mongomapper myself.
Update 13/03/2010: I believe the dependency on attr_accessible in clearance has since been removed. So this small hack is most probably defunct.