Guest User

Untitled

a guest
Mar 14th, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. Role.create :name => 'authenticated', :assignable => false
  2. Role.create :name => 'anonymous', :assignable => false
  3.  
  4. user = User.new :name => 'tj', :password => 'foobar', :email => 'foo@bar.com'
  5. user.password_confirmation = 'foobar'
  6. user.email_confirmation = 'foo@bar.com'
  7. p user.save # => true
  8. p user.save(:register) # => validation context register doesn't seem to be defined. Known contexts are [:default]
Add Comment
Please, Sign In to add comment