reform-rails 0.2.0.rc1 → 0.2.0.rc2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 7c305a6d82ff671f19e202c55d4e6ecdbb65b0d7
4
- data.tar.gz: 50fbfe33f1cdc8ec9816fbaaba231900b028bdd8
2
+ SHA256:
3
+ metadata.gz: 9fbc01e9707fe8e853f1f6dfcae4bfeac3595a0d21cf06683a79cc013ef29fa0
4
+ data.tar.gz: 4b3ef3d982c952df0bee7d11af62bdf288f7b2253a743fd5a837421ce8bb38e7
5
5
  SHA512:
6
- metadata.gz: 97c4240b05d195f6005aeab035fab28577057fd0a654a78fd2ed7b212c850ed55073e72366b2fec112dba561a8e73fafc5e3d23231e3bf7eed9fa6da5551c2d4
7
- data.tar.gz: 7121028adddb1ac1e96dc433f7887e9cfdb690fb1914b5e4b89726d29cfb68f1f9b833eaa00149bd880325601c8dd99565da1a41d4539fafbd9f68386198817b
6
+ metadata.gz: f9baab381f33d99fd9b798dba05de302e6fedb1d6c5348562ae6fd79232b8195f216c01b3b2499294c10abc4f88eb69035ba069012f798c0c594a3c70522e107
7
+ data.tar.gz: 7dc2393f4ad2a354e77031be6a4b1b4d4a99af95c6b6782ccec08ae6e3c70cc89393b727f74338c907027d8d990600025069022db0807c5212b1ce7c32e24cae
@@ -14,9 +14,12 @@ env:
14
14
  - "RAILS_VERSION=4.1.0"
15
15
  - "RAILS_VERSION=4.2.0"
16
16
  - "RAILS_VERSION=5.0.0"
17
+ - "RAILS_VERSION=5.1.0"
17
18
  matrix:
18
19
  fast_finish: true
19
20
  exclude:
21
+ - rvm: 2.1.10
22
+ env: "RAILS_VERSION=5.1.0"
20
23
  - rvm: 2.1.10
21
24
  env: "RAILS_VERSION=5.0.0"
22
25
  - rvm: 2.4.0
data/CHANGES.md CHANGED
@@ -8,6 +8,7 @@
8
8
  * improve handling of persisted records in uniqueness validator
9
9
  * remove params.merge! as it's deprecated in rails 5
10
10
  * update to support reform 2.3, the new API means that `errors.add` is delegated to ActiveModel::Errors so we have support for rails 5 :descriptions without having to do anything !Yey!
11
+ * Fix nested form validation (#53)
11
12
 
12
13
  # 0.1.7 (0.1.6 Yanked)
13
14
 
Binary file
@@ -58,10 +58,11 @@ module Reform
58
58
  super.tap do
59
59
  # @fran: super ugly hack thanks to the shit architecture of AMV. let's drop it in 3.0 and move on!
60
60
  all_errors = @result.instance_variable_get(:@results)
61
+ nested_errors = @result.instance_variable_get(:@failure)
61
62
 
62
- @result = Reform::Contract::Result.new(all_errors)
63
+ @result = Reform::Contract::Result.new(all_errors, [nested_errors].compact)
63
64
 
64
- @amv_errors = Result::ResultErrors.new(@result, self, @result.success?)
65
+ @amv_errors = Result::ResultErrors.new(@result, self, @result.success?, @amv_errors)
65
66
  end
66
67
  @result
67
68
  end
@@ -109,9 +110,10 @@ module Reform
109
110
  end
110
111
 
111
112
  class ResultErrors < ::Reform::Contract::Result::Errors # to expose via #errors. i hate it.
112
- def initialize(a, b, success)
113
+ def initialize(a, b, success, amv_errors)
113
114
  super(a, b)
114
115
  @success = success
116
+ @amv_errors = amv_errors
115
117
  end
116
118
 
117
119
  def empty?
@@ -126,6 +128,10 @@ module Reform
126
128
  def to_s
127
129
  messages.to_s
128
130
  end
131
+
132
+ def method_missing(m, *args, &block)
133
+ @amv_errors.send(m, *args, &block) # send all methods to the AMV errors, even privates.
134
+ end
129
135
  end
130
136
  end
131
137
 
@@ -1,5 +1,5 @@
1
1
  module Reform
2
2
  module Rails
3
- VERSION = "0.2.0.rc1"
3
+ VERSION = "0.2.0.rc2"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: reform-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0.rc1
4
+ version: 0.2.0.rc2
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-02-26 00:00:00.000000000 Z
11
+ date: 2018-03-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: reform
@@ -208,7 +208,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
208
208
  version: 1.3.1
209
209
  requirements: []
210
210
  rubyforge_project:
211
- rubygems_version: 2.6.3
211
+ rubygems_version: 2.7.3
212
212
  signing_key:
213
213
  specification_version: 4
214
214
  summary: Automatically load and include all common Rails form features.