Sha256: 146d4b3ca8cf89c1c85a488f6a2cb931a4af1068c5f4d7c97724970dfad5e893

Contents?: true

Size: 375 Bytes

Versions: 174

Compression:

Stored size: 375 Bytes

Contents

# frozen_string_literal: true

module ActionView
  module ModelNaming #:nodoc:
    # 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

174 entries across 166 versions & 11 rubygems

Version Path
zuora_connect_ui-0.10.0 vendor/ruby/2.6.0/gems/actionview-6.0.0/lib/action_view/model_naming.rb
zuora_connect_ui-0.10.0 vendor/ruby/2.6.0/gems/actionview-5.2.3/lib/action_view/model_naming.rb
zuora_connect_ui-0.10.0 vendor/ruby/2.6.0/gems/actionview-6.0.1/lib/action_view/model_naming.rb
actionview-5.2.4 lib/action_view/model_naming.rb
actionview-6.0.2.rc1 lib/action_view/model_naming.rb
actionview-5.2.4.rc1 lib/action_view/model_naming.rb
zuora_connect_ui-0.9.2 vendor/ruby/2.6.0/gems/actionview-6.0.0/lib/action_view/model_naming.rb
zuora_connect_ui-0.9.2 vendor/ruby/2.6.0/gems/actionview-5.2.3/lib/action_view/model_naming.rb
zuora_connect_ui-0.9.2 vendor/ruby/2.6.0/gems/actionview-6.0.1/lib/action_view/model_naming.rb
actionview-6.0.1 lib/action_view/model_naming.rb
chatops-rpc-0.0.2 fixtures/chatops-controller-example/vendor/bundle/ruby/2.5.0/gems/actionview-6.0.0/lib/action_view/model_naming.rb
actionview-6.0.1.rc1 lib/action_view/model_naming.rb
chatops-rpc-0.0.1 fixtures/chatops-controller-example/vendor/bundle/ruby/2.5.0/gems/actionview-6.0.0/lib/action_view/model_naming.rb
zuora_connect_ui-0.9.1 vendor/ruby/2.6.0/gems/actionview-6.0.0/lib/action_view/model_naming.rb
zuora_connect_ui-0.9.1 vendor/ruby/2.6.0/gems/actionview-5.2.3/lib/action_view/model_naming.rb
zuora_connect_ui-0.9.0 vendor/ruby/2.6.0/gems/actionview-6.0.0/lib/action_view/model_naming.rb
zuora_connect_ui-0.9.0 vendor/ruby/2.6.0/gems/actionview-5.2.3/lib/action_view/model_naming.rb
zuora_connect_ui-0.8.3 vendor/ruby/2.6.0/gems/actionview-6.0.0/lib/action_view/model_naming.rb
zuora_connect_ui-0.8.3 vendor/ruby/2.6.0/gems/actionview-5.2.3/lib/action_view/model_naming.rb
zuora_connect_ui-0.8.2 vendor/ruby/2.6.0/gems/actionview-6.0.0/lib/action_view/model_naming.rb