Module: Merb::Orms::Sequel::Model::ActiveModelCompatibility
- Defined in:
- lib/merb/orms/sequel/model.rb
Overview
This code has been taken from Sequel 3.5.0 Sequel::Plugins::ActiveModel sequel.rubyforge.org/rdoc-plugins/classes/Sequel/Plugins/ActiveModel.html
Instance Method Summary collapse
-
#after_destroy ⇒ Object
Record that an object was destroyed, for later use by destroyed?.
-
#destroyed? ⇒ Boolean
Whether the object was destroyed by destroy.
-
#new_record? ⇒ Boolean
An alias for new?.
-
#to_model ⇒ Object
With the ActiveModel plugin, Sequel model objects are already compliant, so this returns self.
Instance Method Details
#after_destroy ⇒ Object
Record that an object was destroyed, for later use by destroyed?
12 13 14 15 |
# File 'lib/merb/orms/sequel/model.rb', line 12 def after_destroy super @destroyed = true end |
#destroyed? ⇒ Boolean
Whether the object was destroyed by destroy. Not true for objects that were deleted.
19 20 21 |
# File 'lib/merb/orms/sequel/model.rb', line 19 def destroyed? @destroyed == true end |
#new_record? ⇒ Boolean
An alias for new?
24 25 26 |
# File 'lib/merb/orms/sequel/model.rb', line 24 def new_record? new? end |
#to_model ⇒ Object
With the ActiveModel plugin, Sequel model objects are already compliant, so this returns self.
30 31 32 |
# File 'lib/merb/orms/sequel/model.rb', line 30 def to_model self end |