Module: ActionView::ModelNaming
Do not use. This module is for internal use only.
Relationships & Source Files | |
Extension / Inclusion / Inheritance Descendants | |
Extended In:
| |
Included In:
| |
Defined in: | actionview/lib/action_view/model_naming.rb |
Instance Method Summary
-
#convert_to_model(object)
Converts the given object to an Active Model compliant one.
- #model_name_from_record_or_class(record_or_class)
Instance Method Details
#convert_to_model(object)
Converts the given object to an Active Model compliant one.
# File 'actionview/lib/action_view/model_naming.rb', line 6
def convert_to_model(object) object.respond_to?(:to_model) ? object.to_model : object end
#model_name_from_record_or_class(record_or_class)
[ GitHub ]# File 'actionview/lib/action_view/model_naming.rb', line 10
def model_name_from_record_or_class(record_or_class) convert_to_model(record_or_class).model_name end