Skip to content
This repository has been archived by the owner on Jul 27, 2021. It is now read-only.

Commit

Permalink
カラムマッパの初期化処理をgem読み込みと同時に行うように変更
Browse files Browse the repository at this point in the history
  • Loading branch information
YOSHIDA Hiroki committed Jul 3, 2014
1 parent f3c3cc6 commit 40b525f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
5 changes: 5 additions & 0 deletions lib/comable/engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,10 @@
module Comable
class Engine < ::Rails::Engine
isolate_namespace Comable

# Bulletと競合するため、Bulletよりあとに有効になるよう初期化順序を調整
initializer :comable_columns_mapper do
config.after_initialize { Comable::ColumnsMapper.enable }
end
end
end
11 changes: 0 additions & 11 deletions spec/dummy/config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,5 @@ class Application < Rails::Application
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
config.i18n.default_locale = :ja
I18n.enforce_available_locales = true

config.after_initialize do
# for Bullet
if Rails.env.test?
Bullet.enable = true
Bullet.bullet_logger = true
Bullet.raise = true
end

Comable::ColumnsMapper.enable
end
end
end
7 changes: 7 additions & 0 deletions spec/dummy/config/environments/test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,11 @@

# Print deprecation notices to the stderr.
config.active_support.deprecation = :stderr

# for Bullet
config.after_initialize do
Bullet.enable = true
Bullet.bullet_logger = true
Bullet.raise = true
end
end

0 comments on commit 40b525f

Please sign in to comment.