Skip to content

Instantly share code, notes, and snippets.

@brandoncordell
Created September 15, 2012 05:10
Show Gist options
  • Save brandoncordell/3726415 to your computer and use it in GitHub Desktop.
Save brandoncordell/3726415 to your computer and use it in GitHub Desktop.
Sorcery with Mongoid isn't persisting the username or email field
class User
include Mongoid::Document
authenticates_with_sorcery!
attr_accessor :username, :email, :password, :password_confirmation
attr_accessible :username, :email, :password, :password_confirmation
field :_id, type: String, default: -> { username.to_s.parameterize }
field :username, type: String
field :email, type: String
field :crypted_password, type: String
field :salt, type: String
end
Parameters: {
"utf8"=>"✓",
"authenticity_token"=>"cHo4kDYQ9186rAbcnkje4oi7WXhcw8Sg4/WXwN1EWbs=",
"user"=>{
"username"=>"asdfsdf",
"email"=>"[email protected]",
"password"=>"[FILTERED]",
"password_confirmation"=>"[FILTERED]"
},
"commit"=>"Save"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment