Module: Ripple::Conversion
- Extended by:
- ActiveSupport::Concern
- Includes:
- ActiveModel::Conversion
- Defined in:
- lib/ripple/conversion.rb
Overview
Provides ActionPack compatibility for Document models.
Instance Method Summary collapse
-
#new_record? ⇒ Boolean
True if this is a new document.
-
#persisted? ⇒ Boolean
True if this is not a new document.
-
#to_key ⇒ Object
Converts to a view key.
-
#to_param ⇒ Object
Converts to a URL parameter.
Instance Method Details
#new_record? ⇒ Boolean
True if this is a new document
10 11 12 |
# File 'lib/ripple/conversion.rb', line 10 def new_record? new? end |
#persisted? ⇒ Boolean
True if this is not a new document
15 16 17 |
# File 'lib/ripple/conversion.rb', line 15 def persisted? !new? end |
#to_key ⇒ Object
Converts to a view key
20 21 22 |
# File 'lib/ripple/conversion.rb', line 20 def to_key new? ? nil : [key] end |
#to_param ⇒ Object
Converts to a URL parameter
25 26 27 |
# File 'lib/ripple/conversion.rb', line 25 def to_param key end |