Hi,
I have Article model and it has aasm_column qa, that is initially
"pending".
In order to get it reset qa column on new versions, I have made:
def set_new_version
write_attribute(:qa, "pending")
end
But now the aasm methods are also triggering the new version, dispite:
self.non_versioned_columns << ''updated_at''
self.non_versioned_columns << ''created_at''
self.non_versioned_columns << ''qa''
self.non_versioned_columns << ''published_at''
How to make the approve! method to start working, while data change
should trigger qa reset?
Tom
PS Here is saple code:
class Article < ActiveRecord::Base
include AASM
aasm_column :qa
aasm_initial_state :pending
aasm_state :pending
aasm_state :approved
aasm_state :rejected
aasm_event :approve do
transitions :from => :pending, :to => :approved, :guard => :valid?
end
aasm_event :reject do
transitions :from => :pending, :to => :rejected, :guard => :valid?
end
acts_as_versioned
self.non_versioned_columns << ''updated_at''
self.non_versioned_columns << ''created_at''
self.non_versioned_columns << ''qa''
self.non_versioned_columns << ''published_at''
def set_new_version
write_attribute(:qa, "pending")
end
end
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---