Sha256: a829343cddab765d78f531926426bfc130ea30625356ca93db29ff64c3330561
Contents?: true
Size: 796 Bytes
Versions: 4
Compression:
Stored size: 796 Bytes
Contents
class Model < ActiveRecord::Base after_create :after_create_callback after_save :after_save_callback1, :after_save_callback2 before_save :before_save_callback1, :before_save_callback2 belongs_to :associated_model, :class_name => 'Model' if respond_to? :around_save around_save :around_save_callback1, :around_save_callback2 end def after_create_callback; end def after_save_callback1; end def after_save_callback2; end def before_save_callback1; end def before_save_callback2; end def around_save_callback1; yield; end def around_save_callback2; yield; end end class StiParent < ActiveRecord::Base self.table_name = 'sti_models' before_save :crash validate :crash def crash raise 'callback was run' end end class StiChild < StiParent end
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
rspec_candy-0.5.1 | spec/support/models.rb |
rspec_candy-0.5.0 | spec/support/models.rb |
rspec_candy-0.4.1 | spec/support/models.rb |
rspec_candy-0.4.0 | spec/support/models.rb |