trailblazer-rails 0.3.2 → 0.4.0

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: 268e6ac8371df8a907dcc5a3a280a7a0dd3b4a29
4
- data.tar.gz: ac30dd3a148ee6377a911e0a9124e903b1573b7a
3
+ metadata.gz: c434809f9717c0abdb110d4027883ec53ec0668d
4
+ data.tar.gz: 55108603787411cd497a0261c525008bcac8d627
5
5
  SHA512:
6
- metadata.gz: 2d9735bed1832212e610e7b6948bd622b7b7c8a2d6f1e1a2f72d020363aa0829a7472c406c8a91e49b6f4abccb7746cbc8b147a23d91e0364be562ba9fac1ba3
7
- data.tar.gz: 797eb700c8b1529feaf034f454b1611dde3c2ab5dfe7efbb7803c2112358402d1d77640168133849f6909e7c4f61d6548575d096d7f87b53135c322ad513d057
6
+ metadata.gz: fb5c793ad95a77ecc2d744eee573df819617204f50369e54b1eb27d6ec4d70b9149852a0e2f1688232422a7b1d5626734369bf1ff43aecdeb086ac3202bc0a39
7
+ data.tar.gz: d07ffb10ca139fd95e7c8a7e64415a1817d1d730bd96fc64b33e429d28ecdc4e842a566c08b9c5664f6f8dde9b43b48505b422b68f10cd8ba2de34a118eaa9c8
data/CHANGES.md CHANGED
@@ -1,3 +1,8 @@
1
+ # 0.4.0
2
+
3
+ * Better engines support.
4
+ * Fix `Responder#errors` by simply removing it and letting `Operation#errors` return the contract errors.
5
+
1
6
  # 0.3.2
2
7
 
3
8
  * Make it work with Rails 3.x, again.
@@ -12,11 +12,6 @@ module Trailblazer::Operation::Responder
12
12
  extend Forwardable
13
13
  def_delegators :@model, :to_param, :destroyed?, :persisted?
14
14
 
15
- def errors
16
- return [] if @valid
17
- [1]
18
- end
19
-
20
15
  def to_model
21
16
  @model
22
17
  end
@@ -4,7 +4,16 @@ require "trailblazer/loader"
4
4
  module Trailblazer
5
5
  class Railtie < ::Rails::Railtie
6
6
  def self.load_concepts(app)
7
- Loader.new.(insert: [ModelFile, before: Loader::AddConceptFiles]) { |file| require_dependency("#{app.root}/#{file}") }
7
+ # Loader.new.(insert: [ModelFile, before: Loader::AddConceptFiles]) { |file| require_dependency("#{app.root}/#{file}") }
8
+ load_for(app)
9
+
10
+ ::Rails.application.railties.find_all { |tie| tie.is_a?(::Rails::Engine) }.each do |engine|
11
+ load_for(engine)
12
+ end
13
+ end
14
+
15
+ def self.load_for(app)
16
+ Loader.new.(prepend: AllModelFiles, root: app.root) { |file| require_dependency(file) }
8
17
  end
9
18
 
10
19
  # This is to autoload Operation::Dispatch, etc. I'm simply assuming people find this helpful in Rails.
@@ -37,6 +46,11 @@ module Trailblazer
37
46
  File.exist?(model) ? [model]+input : input
38
47
  end
39
48
 
49
+ # Load all model files before any TRB files.
50
+ AllModelFiles = ->(input, options) do
51
+ Dir.glob("#{options[:root]}/app/models/**/*.rb") + input
52
+ end
53
+
40
54
  private
41
55
 
42
56
  def reloader_class
@@ -1,5 +1,5 @@
1
1
  module Trailblazer
2
2
  module Rails
3
- VERSION = "0.3.2"
3
+ VERSION = "0.4.0"
4
4
  end
5
5
  end
@@ -17,7 +17,7 @@ Gem::Specification.new do |spec|
17
17
  spec.require_paths = ["lib"]
18
18
 
19
19
  spec.add_dependency "trailblazer", ">= 1.0.4"
20
- spec.add_dependency "trailblazer-loader", ">= 0.0.7"
20
+ spec.add_dependency "trailblazer-loader", ">= 0.1.0"
21
21
  spec.add_dependency "reform-rails", ">= 0.1.4"
22
22
 
23
23
  spec.add_development_dependency "bundler", "~> 1.10"
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: 0.3.2
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nick Sutterer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-07-09 00:00:00.000000000 Z
11
+ date: 2016-11-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: trailblazer
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: 0.0.7
33
+ version: 0.1.0
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: 0.0.7
40
+ version: 0.1.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: reform-rails
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -236,7 +236,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
236
236
  version: '0'
237
237
  requirements: []
238
238
  rubyforge_project:
239
- rubygems_version: 2.4.8
239
+ rubygems_version: 2.6.3
240
240
  signing_key:
241
241
  specification_version: 4
242
242
  summary: Convenient Rails support for Trailblazer.