Sha256: 2a9d3efbb0c93f4dd8ff96471a7eba5e83268d365d4b271671518d780a3360e1

Contents?: true

Size: 461 Bytes

Versions: 7

Compression:

Stored size: 461 Bytes

Contents

module ActiveModel
  module Naming
    private
    
    def self.model_name_from_record_or_class(record_or_class)
      return record_class if record_or_class.is_a?(Class)

      model_name = convert_to_model(record_or_class).class.model_name
      new_record_or_class = Voluntary::Helpers::Application.root_model_class_name_helper(model_name.constantize.new).constantize.new
      
      convert_to_model(new_record_or_class).class.model_name
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
voluntary-0.1.0 vendor_extensions/active_model/naming.rb
voluntary-0.1.0.rc4 vendor_extensions/active_model/naming.rb
voluntary-0.1.0.rc3 vendor_extensions/active_model/naming.rb
voluntary-0.1.0.rc2 vendor_extensions/active_model/naming.rb
voluntary-0.1.0.rc1 vendor_extensions/active_model/naming.rb
voluntary-0.0.3 vendor_extensions/active_model/naming.rb
voluntary-0.0.1 lib/vendors/active_model/naming.rb