Module: Morpheus::Mixins::Conversion
- Included in:
- Base
- Defined in:
- lib/morpheus/mixins/conversion.rb
Instance Method Summary collapse
Instance Method Details
#to_key ⇒ Object
13 14 15 |
# File 'lib/morpheus/mixins/conversion.rb', line 13 def to_key attributes.keys if persisted? end |
#to_model ⇒ Object
5 6 7 |
# File 'lib/morpheus/mixins/conversion.rb', line 5 def to_model self end |
#to_param ⇒ Object
9 10 11 |
# File 'lib/morpheus/mixins/conversion.rb', line 9 def to_param id.to_s unless new_record? end |
#to_partial_path ⇒ Object
17 18 19 20 |
# File 'lib/morpheus/mixins/conversion.rb', line 17 def to_partial_path underscored_model_name = self.class.model_name.underscore "#{underscored_model_name.pluralize}/#{underscored_model_name}" end |