Sha256: 74c536731ca29cb02952eb27e3e09a91cd463c0e9d47c738512443c530ef382f

Contents?: true

Size: 498 Bytes

Versions: 49

Compression:

Stored size: 498 Bytes

Contents

# require "eitil_core/application_record/all_associations"

# require "eitil_core/railtie" to run the dynamic dispatch as an init hook during boot
require "eitil_core/railtie"

module EitilCore
  module ApplicationRecord
    module AllAssociations

      Eitil::ApplicationRecordModules << self

      def all_associations
        reflect_on_all_associations.map do |assoc|
          { assoc.name => assoc.association_class.to_s.demodulize }
        end.inject &:merge
      end

    end
  end
end

Version data entries

49 entries across 49 versions & 1 rubygems

Version Path
eitil-2.0.8 eitil_core/lib/eitil_core/application_record/all_associations.rb
eitil-2.0.7 eitil_core/lib/eitil_core/application_record/all_associations.rb
eitil-2.0.6 eitil_core/lib/eitil_core/application_record/all_associations.rb
eitil-2.0.5 eitil_core/lib/eitil_core/application_record/all_associations.rb
eitil-2.0.4 eitil_core/lib/eitil_core/application_record/all_associations.rb
eitil-2.0.3 eitil_core/lib/eitil_core/application_record/all_associations.rb
eitil-2.0.2 eitil_core/lib/eitil_core/application_record/all_associations.rb
eitil-2.0.1 eitil_core/lib/eitil_core/application_record/all_associations.rb
eitil-2.0.0 eitil_core/lib/eitil_core/application_record/all_associations.rb
eitil-1.4.1 eitil_core/lib/eitil_core/application_record/all_associations.rb
eitil-1.4.0 eitil_core/lib/eitil_core/application_record/all_associations.rb
eitil-1.3.12 eitil_core/lib/eitil_core/application_record/all_associations.rb
eitil-1.3.11 eitil_core/lib/eitil_core/application_record/all_associations.rb
eitil-1.3.10 eitil_core/lib/eitil_core/application_record/all_associations.rb
eitil-1.3.9 eitil_core/lib/eitil_core/application_record/all_associations.rb
eitil-1.3.8 eitil_core/lib/eitil_core/application_record/all_associations.rb
eitil-1.3.7 eitil_core/lib/eitil_core/application_record/all_associations.rb
eitil-1.3.6 eitil_core/lib/eitil_core/application_record/all_associations.rb
eitil-1.3.5 eitil_core/lib/eitil_core/application_record/all_associations.rb
eitil-1.3.4 eitil_core/lib/eitil_core/application_record/all_associations.rb