Sha256: 858bd84d12c32acaca62a8ff67ae2eb55f9ef2e1c99eb4d272f0e69485cac9a5

Contents?: true

Size: 608 Bytes

Versions: 22

Compression:

Stored size: 608 Bytes

Contents

require 'geocoder/models/active_record'

module Geocoder
  if defined? Rails::Railtie
    require 'rails'
    class Railtie < Rails::Railtie
      initializer 'geocoder.insert_into_active_record', before: :load_config_initializers do
        ActiveSupport.on_load :active_record do
          Geocoder::Railtie.insert
        end
      end
      rake_tasks do
        load "tasks/geocoder.rake"
        load "tasks/maxmind.rake"
      end
    end
  end

  class Railtie
    def self.insert
      if defined?(::ActiveRecord)
        ::ActiveRecord::Base.extend(Model::ActiveRecord)
      end
    end
  end
end

Version data entries

22 entries across 22 versions & 2 rubygems

Version Path
really-broken-geocoder-1.5.1 lib/geocoder/railtie.rb
geocoder-1.5.1 lib/geocoder/railtie.rb