Skip to content

Commit

Permalink
Rails execute action_controller onload hooks for Both ActionControl…
Browse files Browse the repository at this point in the history
…ler::Base and ActionController::API.

Rails [introduced](rails/rails#30045) `has_one` option to limit executions to one

This will fix #173 for rails 5.1.4 and above
  • Loading branch information
redtachyons authored and tachyons committed Nov 3, 2017
1 parent f9f3982 commit ce1cabd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ rvm:

env:
- RAILS_VERSION=5.0.3
- RAILS_VERSION=5.1
- RAILS_VERSION=5.1.1
2 changes: 1 addition & 1 deletion lib/merit.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class Engine < Rails::Engine
initializer 'merit.controller' do |app|
extend_orm_with_has_merit
require_models
ActiveSupport.on_load(:action_controller) do
ActiveSupport.on_load(:action_controller, run_once: true) do
begin
# Load app rules on boot up
Merit::AppBadgeRules = Merit::BadgeRules.new.defined_rules
Expand Down

0 comments on commit ce1cabd

Please sign in to comment.