trailblazer-rails 1.0.1 → 1.0.2

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: 3cf8c3a411e8572f6e8d0909cc12be8689003dee
4
- data.tar.gz: 85c774a47cd27eb23a12f420c88bd4cfff2d0ee9
3
+ metadata.gz: e1313bd4f72d3a94c54b3565eb18fa509b1ba16a
4
+ data.tar.gz: 01c119ddb120184b4f27c5eaf3faa8f2e3452ada
5
5
  SHA512:
6
- metadata.gz: dd1d1b28b4567de47ae22578741094cabc6afb8cccfa0e2b82238a8d14a70378257390f4bcf090c28b62b7f3995445c4f7cbd80b5a0cb16ed12fa703aedd5c83
7
- data.tar.gz: 9a818102898e9a6685e4f6871a39c7faa5c2924377f86f2f3067cabf7dc2ea1048d7dfd799e88e51af39b76bacd2157d54708f7f644dc1240e1b89ea64d0a0e4
6
+ metadata.gz: 2bd3394a4eb34d70973f4056027a80400dcc98a76401a813b311cac8b094b66eee32aaf8ac83c4d002df1af54043ae083dcf581ca64bf1c03335bef2dbb4b517
7
+ data.tar.gz: 007045af867c51efe9b0941ed81a8407238711374dfa9ea4cd4f7d01a0586397284fd836c7c0e7961b3232b7622b74cb2bf7c4242d00d0e1b05ff0ab4f1e5f5d
data/CHANGES.md CHANGED
@@ -1,3 +1,7 @@
1
+ # 1.0.2
2
+
3
+ * Allow configuring `ApplicationController` constant via `config.trailblazer.application_controller`.
4
+
1
5
  # 1.0.1
2
6
 
3
7
  * Allow using this gem without `cells,` by loading cells support only when the `cells` gem got detected. Thanks to @promisedlandt.
@@ -8,7 +8,7 @@ end
8
8
  require "reform/rails"
9
9
 
10
10
  require "trailblazer/rails/controller"
11
- require "trailblazer/rails/controller/cell"
11
+ require "trailblazer/rails/cell"
12
12
  require "trailblazer/rails/form"
13
13
  require "trailblazer/rails/railtie"
14
14
  require "trailblazer"
@@ -3,6 +3,9 @@ require "trailblazer/loader"
3
3
 
4
4
  module Trailblazer
5
5
  class Railtie < ::Rails::Railtie
6
+ config.trailblazer = ActiveSupport::OrderedOptions.new
7
+ config.trailblazer.application_controller ||= :ApplicationController
8
+
6
9
  def self.load_concepts(app)
7
10
  # Loader.new.(insert: [ModelFile, before: Loader::AddConceptFiles]) { |file| require_dependency("#{app.root}/#{file}") }
8
11
  load_for(app)
@@ -29,14 +32,9 @@ module Trailblazer
29
32
  end
30
33
  end
31
34
 
32
- # initializer "trailblazer.roar" do
33
- # require "trailblazer/rails/roar" #if Object.const_defined?(:Roar)
34
- # end
35
-
36
- initializer "trailblazer.application_controller" do
35
+ initializer "trailblazer.application_controller" do |app|
37
36
  reloader_class.to_prepare do
38
- ApplicationController.send :include, Trailblazer::Rails::Controller
39
- ApplicationController.send :include, Trailblazer::Rails::Controller::Cell if defined?(::Cell)
37
+ Trailblazer::Railtie.extend_application_controller!(app)
40
38
  end
41
39
  end
42
40
 
@@ -63,5 +61,12 @@ module Trailblazer
63
61
  ActionDispatch::Reloader
64
62
  end
65
63
  end
64
+
65
+ def self.extend_application_controller!(app)
66
+ application_controller = app.config.trailblazer.application_controller.to_s.constantize
67
+
68
+ application_controller.send :include, Trailblazer::Rails::Controller
69
+ application_controller.send :include, Trailblazer::Rails::Controller::Cell if defined?(::Cell)
70
+ end
66
71
  end
67
72
  end
@@ -1,5 +1,5 @@
1
1
  module Trailblazer
2
2
  module Rails
3
- VERSION = "1.0.1"
3
+ VERSION = "1.0.2"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: trailblazer-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nick Sutterer
@@ -164,8 +164,8 @@ files:
164
164
  - Rakefile
165
165
  - lib/trailblazer/operation/responder.rb
166
166
  - lib/trailblazer/rails.rb
167
+ - lib/trailblazer/rails/cell.rb
167
168
  - lib/trailblazer/rails/controller.rb
168
- - lib/trailblazer/rails/controller/cell.rb
169
169
  - lib/trailblazer/rails/form.rb
170
170
  - lib/trailblazer/rails/railtie.rb
171
171
  - lib/trailblazer/rails/test/integration.rb