Sha256: 44741c1efd94a4d1b5074a1d52b5ea647686700456eefbac4f5b6133af9f10fc
Contents?: true
Size: 992 Bytes
Versions: 13
Compression:
Stored size: 992 Bytes
Contents
def act &block @action ||= identify_action if ActManager.act_card add_to_act &block else start_new_act &block end end def start_new_act self.director = nil ActManager.run_act(self) do run_callbacks(:act) { yield } end end def add_to_act # if only_storage_phase is true then the card is already part of the act return yield if ActManager.act_card == self || only_storage_phase director.reset_stage director.update_card self self.only_storage_phase = true yield end module ClassMethods def create! opts card = Card.new opts card.act do card.save! end card end def create opts card = Card.new opts card.act do card.save end card end end def save!(*) act { super } end def save(*) act { super } end def valid?(*) act { super } end def update *args act { super } end def update! *args act { super } end alias_method :update_attributes, :update alias_method :update_attributes!, :update!
Version data entries
13 entries across 13 versions & 1 rubygems