Module: Mongomatic::ActiveModelCompliancy
- Included in:
- Base
- Defined in:
- lib/mongomatic/active_model_compliancy.rb
Instance Method Summary collapse
- #destroyed? ⇒ Boolean
- #new_record? ⇒ Boolean
- #persisted? ⇒ Boolean
- #to_key ⇒ Object
- #to_model ⇒ Object
- #to_param ⇒ Object
Instance Method Details
#destroyed? ⇒ Boolean
12 13 14 |
# File 'lib/mongomatic/active_model_compliancy.rb', line 12 def destroyed? removed? end |
#new_record? ⇒ Boolean
8 9 10 |
# File 'lib/mongomatic/active_model_compliancy.rb', line 8 def new_record? new? end |
#persisted? ⇒ Boolean
16 17 18 |
# File 'lib/mongomatic/active_model_compliancy.rb', line 16 def persisted? !new? end |
#to_key ⇒ Object
20 21 22 |
# File 'lib/mongomatic/active_model_compliancy.rb', line 20 def to_key self["_id"] end |
#to_model ⇒ Object
4 5 6 |
# File 'lib/mongomatic/active_model_compliancy.rb', line 4 def to_model self end |
#to_param ⇒ Object
24 25 26 |
# File 'lib/mongomatic/active_model_compliancy.rb', line 24 def to_param self["_id"] ? self["_id"].to_s : nil end |