Thoughtbot Clearance & mongomapper

Written by Richard. Filed under rails. Bookmark the Permalink. Post a Comment. Leave a Trackback URL.

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.

  def self.attr_accessible(*args)end
  include Clearance::User

My full user model ended up looking like this:

  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.

One Trackback

  1. [...] This post was mentioned on Twitter by Dan Croak, Richard Hart. Richard Hart said: Blog post on getting mongomapper to work with Thoughtbot's clearance. Seemed like a simple enough hack. http://bit.ly/78zFJP [...]

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>