lib/kredis/railtie.rb in kredis-0.1.2 vs lib/kredis/railtie.rb in kredis-0.2.0

- old
+ new

@@ -1,33 +1,33 @@ require "rails/railtie" module Kredis class Railtie < ::Rails::Railtie config.kredis = ActiveSupport::OrderedOptions.new - config.eager_load_namespaces << Kredis initializer "kredis.testing" do ActiveSupport.on_load(:active_support_test_case) do parallelize_setup { |worker| Kredis.namespace = "test-#{worker}" } parallelize_teardown { Kredis.clear_all } end end initializer "kredis.logger" do - Kredis.logger = Rails.logger + Kredis.logger = config.kredis.logger || Rails.logger end initializer "kredis.configurator" do Kredis.configurator = Rails.application end initializer "kredis.attributes" do + # TODO: Add run_load_hooks to ActiveModel::Model so this runs. ActiveSupport.on_load(:active_model) do - ActiveModel::Base.send :include, Kredis::Attributes + include Kredis::Attributes end ActiveSupport.on_load(:active_record) do - ActiveRecord::Base.send :include, Kredis::Attributes + include Kredis::Attributes end end end end