Sha256: 1133878489eb2088cf6371bb15d3fa07787f67be4dc94ee2373b58908199d04b

Contents?: true

Size: 335 Bytes

Versions: 52

Compression:

Stored size: 335 Bytes

Contents

module ActionView
  module ModelNaming
    # Converts the given object to an ActiveModel compliant one.
    def convert_to_model(object)
      object.respond_to?(:to_model) ? object.to_model : object
    end

    def model_name_from_record_or_class(record_or_class)
      convert_to_model(record_or_class).model_name
    end
  end
end

Version data entries

52 entries across 51 versions & 8 rubygems

Version Path
actionview-4.2.11.3 lib/action_view/model_naming.rb
actionview-4.2.11.2 lib/action_view/model_naming.rb
actionview-4.2.11.1 lib/action_view/model_naming.rb
actionview-4.2.11 lib/action_view/model_naming.rb
actionview-4.2.10 lib/action_view/model_naming.rb
actionview-4.2.10.rc1 lib/action_view/model_naming.rb
actionview-4.2.9 lib/action_view/model_naming.rb
actionview-4.2.9.rc2 lib/action_view/model_naming.rb
actionview-4.2.9.rc1 lib/action_view/model_naming.rb
enju_leaf-1.2.1 vendor/bundle/ruby/2.3/gems/actionview-4.2.8/lib/action_view/model_naming.rb
actionview-4.2.8 lib/action_view/model_naming.rb
actionview-4.2.8.rc1 lib/action_view/model_naming.rb
actionview-4.2.7.1 lib/action_view/model_naming.rb
actionview-4.2.7 lib/action_view/model_naming.rb
actionview-4.2.7.rc1 lib/action_view/model_naming.rb
ish_lib_manager-0.0.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/actionview-4.2.6/lib/action_view/model_naming.rb
actionview-4.2.6 lib/action_view/model_naming.rb
actionview-4.2.6.rc1 lib/action_view/model_naming.rb
actionview-4.2.5.2 lib/action_view/model_naming.rb
activejob-lock-0.0.2 rails/actionview/lib/action_view/model_naming.rb