Hi all: Below is s a dump from script/console in development env. Am I not supposed to be able to find the record later and use the state machine functionality, or have I missed something? Thanks Forrest ---------------------------->> ts2 = TalkSession.create( :person_id => 2, :pattern_id => 2)=> #<TalkSession:0x35811f0 @attributes={"pattern_id"=>2, "id"=>11, "person_id"=> 2, "state"=>"looking_for_experts"}, @new_record=false, @errors=#<ActiveRecord::Errors:0x34627b0 @base=#<TalkSession:0x35811f0 ...>, @errors={}>>>> ts3 = TalkSession.find_by_person_id 2=> #<TalkSession:0x32f5f08 @attributes={"pattern_id"=>"2", "id"=>"11", "person_id"=>"2"}>>> ts2.current_state=> :looking_for_experts>> ts3.current_stateNoMethodError: undefined method `state'' for #<TalkSession:0x32f5f08> from c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.3/lib/active_record/base.rb:1792:in `method_missing'' from ./script/../config/../config/../vendor/plugins/acts_as_state_machine/lib/acts_as_state_machine.rb:68:in `current_state'' from (irb):16
Forrest Chang
2006-Jul-13 02:40 UTC
[Rails] Re: having a problem with acts_as_state_machine
Nevermind, figured it out, I didn''t put a column for state in the DB. THanks for listening.. Forrest On 7/12/06, Forrest Chang <fkchang2000@gmail.com> wrote:> Hi all: > > Below is s a dump from script/console in development env. > > Am I not supposed to be able to find the record later and use the > state machine functionality, or have I missed something? Thanks > > Forrest > > ---------------------------- > > >> ts2 = TalkSession.create( :person_id => 2, :pattern_id => 2) > => #<TalkSession:0x35811f0 @attributes={"pattern_id"=>2, "id"=>11, "person_id"=> > 2, "state"=>"looking_for_experts"}, @new_record=false, > @errors=#<ActiveRecord::Errors:0x34627b0 @base=#<TalkSession:0x35811f0 > ...>, @errors={}>> > >> ts3 = TalkSession.find_by_person_id 2 > => #<TalkSession:0x32f5f08 @attributes={"pattern_id"=>"2", "id"=>"11", > "person_id"=>"2"}> > >> ts2.current_state > => :looking_for_experts > >> ts3.current_state > NoMethodError: undefined method `state'' for #<TalkSession:0x32f5f08> > from c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.3/lib/active_record/base.rb:1792:in > `method_missing'' > from ./script/../config/../config/../vendor/plugins/acts_as_state_machine/lib/acts_as_state_machine.rb:68:in > `current_state'' > from (irb):16 >
Hi Forrest Chang, Can u please tell me how can I use the acts_as_state_machine with example. I want to use the plug in for work flow of my application. I am waiting to your reply. Thanks srinivasrao.pala -- 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---