rails--rails/activemodel/lib/active_model/conversion.rb

20 lines
548 B
Ruby
Raw Normal View History

2009-07-21 05:51:57 +00:00
module ActiveModel
2010-01-16 21:56:20 +00:00
# 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.
2009-07-21 05:51:57 +00:00
module Conversion
def to_model
self
end
end
end