Module: ActionController::ModelNaming
- Included in:
- ActionDispatch::Routing::PolymorphicRoutes
- Defined in:
- actionpack/lib/action_controller/model_naming.rb
Instance Method Summary collapse
-
#convert_to_model(object) ⇒ Object
Converts the given object to an ActiveModel compliant one.
- #model_name_from_record_or_class(record_or_class) ⇒ Object
Instance Method Details
#convert_to_model(object) ⇒ Object
Converts the given object to an ActiveModel compliant one.
4 5 6 |
# File 'actionpack/lib/action_controller/model_naming.rb', line 4 def convert_to_model(object) object.respond_to?(:to_model) ? object.to_model : object end |