Class: Undestroy::Binding::ActiveRecord
- Inherits:
-
Object
- Object
- Undestroy::Binding::ActiveRecord
- Defined in:
- lib/undestroy/binding/active_record.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
Returns the value of attribute config.
-
#model ⇒ Object
Returns the value of attribute model.
Instance Method Summary collapse
- #before_destroy(instance) ⇒ Object
-
#initialize(model, options = {}) ⇒ ActiveRecord
constructor
A new instance of ActiveRecord.
Constructor Details
#initialize(model, options = {}) ⇒ ActiveRecord
Returns a new instance of ActiveRecord.
6 7 8 9 10 11 12 13 |
# File 'lib/undestroy/binding/active_record.rb', line 6 def initialize(model, ={}) ensure_is_ar! model self.model = model self.config = Undestroy::Config.config.merge() set_defaults end |
Instance Attribute Details
#config ⇒ Object
Returns the value of attribute config.
4 5 6 |
# File 'lib/undestroy/binding/active_record.rb', line 4 def config @config end |
#model ⇒ Object
Returns the value of attribute model.
4 5 6 |
# File 'lib/undestroy/binding/active_record.rb', line 4 def model @model end |
Instance Method Details
#before_destroy(instance) ⇒ Object
15 16 17 |
# File 'lib/undestroy/binding/active_record.rb', line 15 def before_destroy(instance) config.internals[:archive].new(:config => config, :source => instance).run end |