diff options
Diffstat (limited to 'activemodel/lib/active_model/conversion.rb')
-rw-r--r-- | activemodel/lib/active_model/conversion.rb | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/activemodel/lib/active_model/conversion.rb b/activemodel/lib/active_model/conversion.rb index 78dc34197b..585c20dcdf 100644 --- a/activemodel/lib/active_model/conversion.rb +++ b/activemodel/lib/active_model/conversion.rb @@ -8,9 +8,9 @@ module ActiveModel # class ContactMessage # include ActiveModel::Conversion # - # # Always a new record, since it's not persisted in the DB. - # def new_record? - # true + # # ContactMessage are never persisted in the DB + # def persisted? + # false # end # end # @@ -30,13 +30,13 @@ module ActiveModel self end - # Returns an Enumerable of all (primary) key attributes or nil if new_record? is true + # Returns an Enumerable of all (primary) key attributes or nil if persisted? is fakse def to_key - new_record? ? nil : [id] + persisted? ? [id] : nil end # Returns a string representing the object's key suitable for use in URLs, - # or nil if new_record? is true + # or nil if persisted? is false def to_param to_key ? to_key.join('-') : nil end |