trailblazer-rails 1.0.4 → 1.0.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a00d731d3bb61523513f95f173bcc30e78199b0a
4
- data.tar.gz: 6d198db0cad2bea4e9661e3a9aec5b4cad3fc091
3
+ metadata.gz: 60d8e312cc34a8cf86ba6d4adf0fb5d3a4d178a8
4
+ data.tar.gz: f601570b5823b9b46dd07962a89785d0bff8508e
5
5
  SHA512:
6
- metadata.gz: f12e95e33a107baf386047f45b378033111e7f493ac3f98a725422f4382fc2cf3460f1251a5b1a4338789018a060989d6eb0b659d75f676850f573813f35ebaf
7
- data.tar.gz: ae5ec2d715325622fcaf417e48d3d5bef0f3e4d457f375e844c564fbaf2a7b45a7441929f790b9b1424922f2e44d4d9ab93d80026583b395a2a467e06d9ea79e
6
+ metadata.gz: 53124f47f70adc69246da35cb2a1c9aabd32ec8f1064aa1f1c397b5356282399e0dd06bde285d6437db6b64bc598d39c01e98bd61bbc17433494c378fe5dc39a
7
+ data.tar.gz: 426612868af63cc5b2949b18493ae4d3fb2f4f8155b4aea3ed7d61524cff1b80bbeaccfd2d7a1b56204356d8734cae005e42e4e3d9a5e406c1743e6bcf572544
data/CHANGES.md CHANGED
@@ -1,3 +1,7 @@
1
+ # 1.0.5
2
+
3
+ * Hook trailblazer application_controller initializer to finisher_hook
4
+
1
5
  # 1.0.4
2
6
 
3
7
  * Make `Railtie::extend_application_controller!` overwriteable via a module.
@@ -4,7 +4,8 @@ require "trailblazer/loader"
4
4
  module Trailblazer
5
5
  class Railtie < ::Rails::Railtie
6
6
  config.trailblazer = ActiveSupport::OrderedOptions.new
7
- config.trailblazer.application_controller ||= :ApplicationController
7
+ ## Accept also an Array of controllers
8
+ config.trailblazer.application_controller ||= 'ActionController::Base'
8
9
 
9
10
  def self.load_concepts(app)
10
11
  # Loader.new.(insert: [ModelFile, before: Loader::AddConceptFiles]) { |file| require_dependency("#{app.root}/#{file}") }
@@ -38,9 +39,11 @@ module Trailblazer
38
39
  end
39
40
  end
40
41
 
41
- initializer "trailblazer.application_controller" do |app|
42
+ initializer "trailblazer.application_controller", before: "finisher_hook" do |app|
42
43
  reloader_class.to_prepare do
43
- Trailblazer::Railtie.extend_application_controller!(app)
44
+ ActiveSupport.on_load(:action_controller) do |app|
45
+ Trailblazer::Railtie.extend_application_controller!(app)
46
+ end
44
47
  end
45
48
  end
46
49
 
@@ -70,12 +73,12 @@ module Trailblazer
70
73
 
71
74
  module ExtendApplicationController
72
75
  def extend_application_controller!(app)
73
- application_controller = app.config.trailblazer.application_controller.to_s.constantize
74
-
75
- application_controller.send :include, Trailblazer::Rails::Controller
76
- application_controller.send :include, Trailblazer::Rails::Controller::Cell if defined?(::Cell)
77
-
78
- application_controller
76
+ controllers = Array(::Rails.application.config.trailblazer.application_controller).map{ |x| x.to_s }
77
+ if controllers.include? app.to_s
78
+ app.send :include, Trailblazer::Rails::Controller
79
+ app.send :include, Trailblazer::Rails::Controller::Cell if defined?(::Cell)
80
+ end
81
+ app
79
82
  end
80
83
  end
81
84
 
@@ -1,5 +1,5 @@
1
1
  module Trailblazer
2
2
  module Rails
3
- VERSION = "1.0.4"
3
+ VERSION = "1.0.5"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: trailblazer-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.4
4
+ version: 1.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nick Sutterer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-07-21 00:00:00.000000000 Z
11
+ date: 2018-02-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: trailblazer
@@ -192,7 +192,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
192
192
  version: '0'
193
193
  requirements: []
194
194
  rubyforge_project:
195
- rubygems_version: 2.6.12
195
+ rubygems_version: 2.6.11
196
196
  signing_key:
197
197
  specification_version: 4
198
198
  summary: Convenient Rails support for Trailblazer.