Sha256: 5694c5ef25488c8854ba2d0263717f9841777edda77c750340664fbeb0673022

Contents?: true

Size: 1.18 KB

Versions: 11

Compression:

Stored size: 1.18 KB

Contents

module EitilCore

  class Railtie < Rails::Railtie

      initializer "my_railtie.configure_rails_initialization", options: :after do |app|

        # Dynamic dispatching after initialization of Rails classes.

        # ApplicationRecord
        
        if Object.const_defined?('EitilCore::ApplicationRecord::WhereLike')
          ::ApplicationRecord.send(:extend, EitilCore::ApplicationRecord::WhereLike)
        end

        if Object.const_defined?('EitilCore::ApplicationRecord::FindByLike')
          ::ApplicationRecord.send(:extend, EitilCore::ApplicationRecord::FindByLike)
        end

        if Object.const_defined?('EitilCore::ApplicationRecord::AllAssociations')
          ::ApplicationRecord.send(:extend, EitilCore::ApplicationRecord::AllAssociations)
        end

        if Object.const_defined?('EitilCore::ApplicationRecord::ModelAtts')
          ::ApplicationRecord.send(:extend, EitilCore::ApplicationRecord::ModelAtts)
        end

        # ApplicationController

        if Object.const_defined?('EitilCore::ApplicationController::SliceParams')
          ::ActionController::API.send(:include, EitilCore::ApplicationController::SliceParams)
        end        

      end

  end

end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
eitil-1.1.16 eitil_core/lib/eitil_core/railtie.rb
eitil-1.1.15 eitil_core/lib/eitil_core/railtie.rb
eitil-1.1.14 eitil_core/lib/eitil_core/railtie.rb
eitil-1.1.13 eitil_core/lib/eitil_core/railtie.rb
eitil-1.1.12 eitil_core/lib/eitil_core/railtie.rb
eitil-1.1.11 eitil_core/lib/eitil_core/railtie.rb
eitil-1.1.10 eitil_core/lib/eitil_core/railtie.rb
eitil-1.1.9 eitil_core/lib/eitil_core/railtie.rb
eitil-1.1.8 eitil_core/lib/eitil_core/railtie.rb
eitil-1.1.7 eitil_core/lib/eitil_core/railtie.rb
eitil-1.1.6 eitil_core/lib/eitil_core/railtie.rb