OK, the first error could be solved. I did not call register! when 
creating the object.

protected
  def create_user(options = {})
    record = User.new({ :login => 'quire',
                        :email => 'qu...@example.com',
                        :first_name => 'Quire',
                        :last_name => 'Quare',
                        :password => 'quire',
                        :password_confirmation => 'quire',
                        :state => 'pending'
                      }.merge(options))
    record.register! if record.valid? # Here I just called record.save 
before
    record
  end

Anyway, why do I have to call record.register! here? What's the 
difference to record.save? I guess it has something to do with 
acts_as_state_machine?
-- 
Posted via http://www.ruby-forum.com/.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to