Module: ActionController::ModelNaming
Relationships & Source Files | |
Extension / Inclusion / Inheritance Descendants | |
Included In:
::AbstractController::UrlFor,
Base,
Redirecting,
UrlFor,
::ActionDispatch::Integration::Session,
::ActionDispatch::IntegrationTest,
::ActionDispatch::Routing::PolymorphicRoutes,
::ActionDispatch::Routing::RouteSet::MountedHelpers,
ActionDispatch::Routing::RoutesProxy,
::ActionDispatch::Routing::UrlFor,
::ActionView::TestCase,
::ActionView::TestCase::Behavior,
::ActionView::TestCase::TestController,
Rails::ApplicationController,
Rails::InfoController,
Rails::MailersController,
Rails::WelcomeController
| |
Defined in: | actionpack/lib/action_controller/model_naming.rb |
Instance Method Summary
-
#convert_to_model(object)
Converts the given object to an ::ActiveModel compliant one.
- #model_name_from_record_or_class(record_or_class)
Instance Method Details
#convert_to_model(object)
Converts the given object to an ::ActiveModel compliant one.
# 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
#model_name_from_record_or_class(record_or_class)
[ GitHub ]# File 'actionpack/lib/action_controller/model_naming.rb', line 8
def model_name_from_record_or_class(record_or_class) convert_to_model(record_or_class).model_name end