Guest User

Untitled

a guest
Apr 12th, 2018
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.01 KB | None | 0 0
  1. ##
  2. >> User.after_create
  3. => [#<UserProfilesEngine::AttachProfileToUser:0xb7723af0>]
  4. ##
  5. >> u = User.new(:email => 'foo@bar.baz', :password => '1234', :password_confirmation => '1234'); u.username = "user#{(rand()*1000).to_i}"; u.save!
  6. ## Error
  7. ActiveRecord::ActiveRecordError: Callbacks must be a symbol denoting the method to call, a string to be evaluated, a block to be invoked, or an object responding to the callback method.
  8. from /var/lib/gems/1.8/gems/activerecord-1.15.3/lib/active_record/callbacks.rb:342:in `callback'
  9. from /var/lib/gems/1.8/gems/activerecord-1.15.3/lib/active_record/callbacks.rb:330:in `each'
  10. from /var/lib/gems/1.8/gems/activerecord-1.15.3/lib/active_record/callbacks.rb:330:in `callback'
  11. from /var/lib/gems/1.8/gems/activerecord-1.15.3/lib/active_record/callbacks.rb:255:in `create_without_timestamps'
  12. from /var/lib/gems/1.8/gems/activerecord-1.15.3/lib/active_record/timestamp.rb:39:in `create'
  13. from /var/lib/gems/1.8/gems/activerecord-1.15.3/lib/active_record/base.rb:1789:in `create_or_update_without_callbacks'
  14. from /var/lib/gems/1.8/gems/activerecord-1.15.3/lib/active_record/callbacks.rb:242:in `create_or_update'
  15. from /var/lib/gems/1.8/gems/activerecord-1.15.3/lib/active_record/base.rb:1551:in `save_without_validation!'
  16. from /var/lib/gems/1.8/gems/activerecord-1.15.3/lib/active_record/validations.rb:762:in `save_without_transactions!'
  17. from /var/lib/gems/1.8/gems/activerecord-1.15.3/lib/active_record/transactions.rb:133:in `save!'
  18. from /var/lib/gems/1.8/gems/activerecord-1.15.3/lib/active_record/connection_adapters/abstract/database_statements.rb:59:in `transaction'
  19. from /var/lib/gems/1.8/gems/activerecord-1.15.3/lib/active_record/transactions.rb:95:in `transaction'
  20. from /var/lib/gems/1.8/gems/activerecord-1.15.3/lib/active_record/transactions.rb:121:in `transaction'
  21. from /var/lib/gems/1.8/gems/activerecord-1.15.3/lib/active_record/transactions.rb:133:in `save!'
  22. from (irb):3
Add Comment
Please, Sign In to add comment