Sha256: 84c83fec0c847eecc232b4b97ba51eadbe5cb3ff04024c19731d0c5b5793dd7b

Contents?: true

Size: 341 Bytes

Versions: 52

Compression:

Stored size: 341 Bytes

Contents

module ActionController
  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
actionpack-4.2.5.1 lib/action_controller/model_naming.rb
angular-rails4-templates-0.4.1 vendor/ruby/2.1.0/gems/actionpack-4.2.4/lib/action_controller/model_naming.rb
angular-rails4-templates-0.4.0 vendor/ruby/2.1.0/gems/actionpack-4.2.4/lib/action_controller/model_naming.rb
angular-rails4-templates-0.3.0 vendor/ruby/2.1.0/gems/actionpack-4.2.4/lib/action_controller/model_naming.rb
actionpack-4.2.5 lib/action_controller/model_naming.rb
actionpack-4.2.5.rc2 lib/action_controller/model_naming.rb
actionpack-4.2.5.rc1 lib/action_controller/model_naming.rb
sc_core-0.0.7 test/dummy/vendor/bundle/ruby/2.2.0/gems/actionpack-4.2.4/lib/action_controller/model_naming.rb
actionpack-4.2.4 lib/action_controller/model_naming.rb
actionpack-4.2.4.rc1 lib/action_controller/model_naming.rb
solidus_backend-1.0.0.pre3 vendor/bundle/gems/actionpack-4.2.3/lib/action_controller/model_naming.rb
solidus_backend-1.0.0.pre2 vendor/bundle/gems/actionpack-4.2.3/lib/action_controller/model_naming.rb
solidus_backend-1.0.0.pre vendor/bundle/gems/actionpack-4.2.2/lib/action_controller/model_naming.rb
solidus_backend-1.0.0.pre vendor/bundle/gems/actionpack-4.2.1/lib/action_controller/model_naming.rb
actionpack-4.2.3 lib/action_controller/model_naming.rb
actionpack-4.2.3.rc1 lib/action_controller/model_naming.rb
actionpack-4.2.2 lib/action_controller/model_naming.rb
shoppe-paypal-1.1.0 vendor/bundle/ruby/2.1.0/gems/actionpack-4.2.1/lib/action_controller/model_naming.rb
actionpack-4.2.1 lib/action_controller/model_naming.rb
actionpack-4.2.1.rc4 lib/action_controller/model_naming.rb