active_interaction 1.1.0 → 1.1.1

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: 940655c81d5b5db1e207b9d317eee3b971ed9fbe
4
- data.tar.gz: 25b6b1d2f3b217bd4e2da202765cbc3058e90da2
3
+ metadata.gz: b7941654d9500bf4b64b71f838949b81e4be213f
4
+ data.tar.gz: 317802247f2ba39e9da4b9f650140d0165d81c76
5
5
  SHA512:
6
- metadata.gz: 7d326ebbed5ed325693ba080bf7b020e9d40d3b23ae832038880782363150af71fefb5b34ea2ac256de1a561062c3fba949be9f3c87728baff587b98ce49d899
7
- data.tar.gz: 2f17941a1de3e1c4ad74c132e93c16dea5a9239bc3cfd03906953f499721c87001acf91a21cf3d89a92fb497039134667859851270781e1225a7f7b2a009d729
6
+ metadata.gz: dbcb64582df589a4e39c8a6c9d45a635d7567f1cd3d8baea79655332d878d2af37b3131eedc8340a8b0f00ca0936653ed3f49df209096e2e767374aa89637ec8
7
+ data.tar.gz: 0bd97e65631c8a201cdd69541dd23683788bc4956d47b204397911ab9fbf71d62152d98be52572da2d6bfde1e4b86e67b46f6169544f3902fa8c59bb40067322
@@ -1,5 +1,10 @@
1
1
  # [Master][]
2
2
 
3
+ # [1.1.1][] (2014-03-04)
4
+
5
+ - Allow merging ActiveModel errors into ActiveInteraction errors with
6
+ `ActiveInteraction::Errors#merge!`.
7
+
3
8
  # [1.1.0][] (2014-02-28)
4
9
 
5
10
  - Only set instance variables for attributes with readers defined.
@@ -154,7 +159,8 @@
154
159
 
155
160
  - Initial release.
156
161
 
157
- [master]: https://github.com/orgsync/active_interaction/compare/v1.1.0...master
162
+ [master]: https://github.com/orgsync/active_interaction/compare/v1.1.1...master
163
+ [1.1.1]: https://github.com/orgsync/active_interaction/compare/v1.1.0...v1.1.1
158
164
  [1.1.0]: https://github.com/orgsync/active_interaction/compare/v1.0.5...v1.1.0
159
165
  [1.0.5]: https://github.com/orgsync/active_interaction/compare/v1.0.4...v1.0.5
160
166
  [1.0.4]: https://github.com/orgsync/active_interaction/compare/v1.0.3...v1.0.4
@@ -41,5 +41,5 @@ I18n.load_path << File.expand_path(
41
41
  #
42
42
  # @since 1.0.0
43
43
  #
44
- # @version 1.1.0
44
+ # @version 1.1.1
45
45
  module ActiveInteraction end
@@ -126,15 +126,29 @@ module ActiveInteraction
126
126
  #
127
127
  # @return [Errors]
128
128
  def merge!(other)
129
- other.symbolic.each do |attribute, symbols|
130
- symbols.each { |s| symbolic[attribute] += [s] }
131
- end
129
+ merge_messages!(other)
130
+ merge_symbolic!(other) if other.respond_to?(:symbolic)
131
+ self
132
+ end
133
+
134
+ private
132
135
 
136
+ def merge_messages!(other)
133
137
  other.messages.each do |attribute, messages|
134
- messages.each { |m| add(attribute, m) unless added?(attribute, m) }
138
+ messages.each do |message|
139
+ add(attribute, message) unless added?(attribute, message)
140
+ end
135
141
  end
142
+ end
136
143
 
137
- self
144
+ def merge_symbolic!(other)
145
+ other.symbolic.each do |attribute, symbols|
146
+ symbols.each do |symbol|
147
+ unless symbolic[attribute].include?(symbol)
148
+ symbolic[attribute] << symbol
149
+ end
150
+ end
151
+ end
138
152
  end
139
153
  end
140
154
  end
@@ -5,5 +5,5 @@ module ActiveInteraction
5
5
  # The version number.
6
6
  #
7
7
  # @return [Gem::Version]
8
- VERSION = Gem::Version.new('1.1.0')
8
+ VERSION = Gem::Version.new('1.1.1')
9
9
  end
@@ -145,5 +145,13 @@ describe ActiveInteraction::Errors do
145
145
  expect { errors.merge!(other) }.to_not raise_error
146
146
  end
147
147
  end
148
+
149
+ context 'with ActiveModel errors' do
150
+ let(:other) { ActiveModel::Errors.new(klass.new) }
151
+
152
+ it 'does not raise an error' do
153
+ expect { errors.merge!(other) }.to_not raise_error
154
+ end
155
+ end
148
156
  end
149
157
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_interaction
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aaron Lasseigne
@@ -9,124 +9,124 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-02-28 00:00:00.000000000 Z
12
+ date: 2014-03-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activemodel
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  requirements:
18
- - - ">="
18
+ - - '>='
19
19
  - !ruby/object:Gem::Version
20
20
  version: '3'
21
- - - "<"
21
+ - - <
22
22
  - !ruby/object:Gem::Version
23
23
  version: '5'
24
24
  type: :runtime
25
25
  prerelease: false
26
26
  version_requirements: !ruby/object:Gem::Requirement
27
27
  requirements:
28
- - - ">="
28
+ - - '>='
29
29
  - !ruby/object:Gem::Version
30
30
  version: '3'
31
- - - "<"
31
+ - - <
32
32
  - !ruby/object:Gem::Version
33
33
  version: '5'
34
34
  - !ruby/object:Gem::Dependency
35
35
  name: bundler
36
36
  requirement: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
38
+ - - ~>
39
39
  - !ruby/object:Gem::Version
40
40
  version: '1.5'
41
41
  type: :development
42
42
  prerelease: false
43
43
  version_requirements: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - "~>"
45
+ - - ~>
46
46
  - !ruby/object:Gem::Version
47
47
  version: '1.5'
48
48
  - !ruby/object:Gem::Dependency
49
49
  name: coveralls
50
50
  requirement: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - "~>"
52
+ - - ~>
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0.7'
55
55
  type: :development
56
56
  prerelease: false
57
57
  version_requirements: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - "~>"
59
+ - - ~>
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0.7'
62
62
  - !ruby/object:Gem::Dependency
63
63
  name: guard-rspec
64
64
  requirement: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - "~>"
66
+ - - ~>
67
67
  - !ruby/object:Gem::Version
68
68
  version: '4.2'
69
69
  type: :development
70
70
  prerelease: false
71
71
  version_requirements: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - "~>"
73
+ - - ~>
74
74
  - !ruby/object:Gem::Version
75
75
  version: '4.2'
76
76
  - !ruby/object:Gem::Dependency
77
77
  name: rake
78
78
  requirement: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - "~>"
80
+ - - ~>
81
81
  - !ruby/object:Gem::Version
82
82
  version: '10.1'
83
83
  type: :development
84
84
  prerelease: false
85
85
  version_requirements: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - "~>"
87
+ - - ~>
88
88
  - !ruby/object:Gem::Version
89
89
  version: '10.1'
90
90
  - !ruby/object:Gem::Dependency
91
91
  name: rdoc
92
92
  requirement: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - "~>"
94
+ - - ~>
95
95
  - !ruby/object:Gem::Version
96
96
  version: '4.1'
97
97
  type: :development
98
98
  prerelease: false
99
99
  version_requirements: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - "~>"
101
+ - - ~>
102
102
  - !ruby/object:Gem::Version
103
103
  version: '4.1'
104
104
  - !ruby/object:Gem::Dependency
105
105
  name: guard-rubocop
106
106
  requirement: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - "~>"
108
+ - - ~>
109
109
  - !ruby/object:Gem::Version
110
110
  version: '1.0'
111
111
  type: :development
112
112
  prerelease: false
113
113
  version_requirements: !ruby/object:Gem::Requirement
114
114
  requirements:
115
- - - "~>"
115
+ - - ~>
116
116
  - !ruby/object:Gem::Version
117
117
  version: '1.0'
118
118
  - !ruby/object:Gem::Dependency
119
119
  name: yard
120
120
  requirement: !ruby/object:Gem::Requirement
121
121
  requirements:
122
- - - "~>"
122
+ - - ~>
123
123
  - !ruby/object:Gem::Version
124
124
  version: '0.8'
125
125
  type: :development
126
126
  prerelease: false
127
127
  version_requirements: !ruby/object:Gem::Requirement
128
128
  requirements:
129
- - - "~>"
129
+ - - ~>
130
130
  - !ruby/object:Gem::Version
131
131
  version: '0.8'
132
132
  description: Manage application specific business logic.
@@ -137,6 +137,10 @@ executables: []
137
137
  extensions: []
138
138
  extra_rdoc_files: []
139
139
  files:
140
+ - CHANGELOG.md
141
+ - LICENSE.txt
142
+ - README.md
143
+ - lib/active_interaction.rb
140
144
  - lib/active_interaction/base.rb
141
145
  - lib/active_interaction/concerns/active_modelable.rb
142
146
  - lib/active_interaction/concerns/hashable.rb
@@ -159,9 +163,9 @@ files:
159
163
  - lib/active_interaction/filters/string_filter.rb
160
164
  - lib/active_interaction/filters/symbol_filter.rb
161
165
  - lib/active_interaction/filters/time_filter.rb
166
+ - lib/active_interaction/locale/en.yml
162
167
  - lib/active_interaction/modules/validation.rb
163
168
  - lib/active_interaction/version.rb
164
- - lib/active_interaction.rb
165
169
  - spec/active_interaction/base_spec.rb
166
170
  - spec/active_interaction/concerns/active_modelable_spec.rb
167
171
  - spec/active_interaction/concerns/hashable_spec.rb
@@ -202,10 +206,6 @@ files:
202
206
  - spec/support/concerns.rb
203
207
  - spec/support/filters.rb
204
208
  - spec/support/interactions.rb
205
- - CHANGELOG.md
206
- - LICENSE.txt
207
- - README.md
208
- - lib/active_interaction/locale/en.yml
209
209
  homepage: http://orgsync.github.io/active_interaction/
210
210
  licenses:
211
211
  - MIT
@@ -216,17 +216,17 @@ require_paths:
216
216
  - lib
217
217
  required_ruby_version: !ruby/object:Gem::Requirement
218
218
  requirements:
219
- - - ">="
219
+ - - '>='
220
220
  - !ruby/object:Gem::Version
221
221
  version: 1.9.3
222
222
  required_rubygems_version: !ruby/object:Gem::Requirement
223
223
  requirements:
224
- - - ">="
224
+ - - '>='
225
225
  - !ruby/object:Gem::Version
226
226
  version: '0'
227
227
  requirements: []
228
228
  rubyforge_project:
229
- rubygems_version: 2.1.11
229
+ rubygems_version: 2.2.0
230
230
  signing_key:
231
231
  specification_version: 4
232
232
  summary: Manage application specific business logic.