diff options
Diffstat (limited to 'activemodel/lib/active_model')
-rw-r--r-- | activemodel/lib/active_model/conversion.rb | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/activemodel/lib/active_model/conversion.rb b/activemodel/lib/active_model/conversion.rb index d5c65920f6..c14a07c7dc 100644 --- a/activemodel/lib/active_model/conversion.rb +++ b/activemodel/lib/active_model/conversion.rb @@ -1,5 +1,16 @@ module ActiveModel - # Include ActiveModel::Conversion if your object "acts like an ActiveModel model". + # If your object is already designed to implement all of the Active Model featurs + # include this module in your Class. + # + # class MyClass + # include ActiveModel::Conversion + # end + # + # Returns self to the <tt>:to_model</tt> method. + # + # If your model does not act like an Active Model object, then you should define + # <tt>:to_model</tt> yourself returning a proxy object that wraps your object + # with Active Model compliant methods. module Conversion def to_model self |