active_interaction 0.2.0 → 0.2.1
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 +6 -14
- data/CHANGELOG.md +15 -6
- data/README.md +2 -2
- data/lib/active_interaction/base.rb +1 -1
- data/lib/active_interaction/version.rb +1 -1
- data/spec/support/interactions.rb +13 -1
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,15 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
metadata.gz: !binary |-
|
9
|
-
OWI3MDgwNGVlY2QxODU5ZGRhMjMyNDRkMzQ5YjI5YTRiM2VhMTU5N2JiYjAx
|
10
|
-
ZmEzNTMyODVlYjQyZGYzOWU4ZDViOGNhN2JmZWY1NDEwZTkxOGFlOTllZDAy
|
11
|
-
ZWZkZjQ0YmVjNmZhMzhjYTc1Mjk2ZmVlZTk2MjhmYTVmOTg0Mjc=
|
12
|
-
data.tar.gz: !binary |-
|
13
|
-
MTQ5ZGZiMTU3ZTAzMzlkNTZmNjIxMzkwN2EwZWE3ZjAzNDZhZDUzYWU3MjUy
|
14
|
-
ZGFhM2YxNTIzYzA4ODI2NDQ2YzE0NmNjYjU3MjI5NGM2NWU3NWVmZGJmMDI2
|
15
|
-
M2IxZDRlNDVjZmZkNjAxYzEyMWY5YjliNjU4NzBhZTM0ZjhmNGM=
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 8f09f8d81f379fd89253838963e3f83afa773d89
|
4
|
+
data.tar.gz: 8b17cb77b2e7c3ec5a3ec2c180aadaf8ba8c3441
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 02798d054bf54db9b2940cfb2b822663cdd49dc8662172efe8cfa120287c942837ce87c3e1864538e3b5cce5b8dde125bdb2a17a162d855b67b426163bcfc660
|
7
|
+
data.tar.gz: 8178136dda58fd2ec4ca0ebf584ad753ab2f3f82a81065225e5e04b0c556f1802cdb76d46aafaa0e4f27b86fe6d28e5f64b30460e83f4dcfe4e0548be9b0a286
|
data/CHANGELOG.md
CHANGED
@@ -1,26 +1,35 @@
|
|
1
|
-
#
|
1
|
+
# [0.2.1][] (2013-08-06)
|
2
2
|
|
3
|
-
|
3
|
+
- Fix setting a default value on more than one attribute at a time.
|
4
|
+
|
5
|
+
# [0.2.0][] (2013-07-16)
|
4
6
|
|
5
7
|
- Wrap interactions in ActiveRecord transactions if they're available.
|
6
8
|
- Add option to strip string values, which is enabled by default.
|
7
9
|
- Add support for strptime format strings on Date, DateTime, and Time filters.
|
8
10
|
|
9
|
-
# 0.1.3
|
11
|
+
# [0.1.3][] (2013-07-16)
|
10
12
|
|
11
13
|
- Fix bug that prevented `attr_accessor`s from working.
|
12
14
|
- Handle unconfigured timezones.
|
13
15
|
- Use RDoc as YARD's Markdown provider instead of kramdown.
|
14
16
|
|
15
|
-
# 0.1.2
|
17
|
+
# [0.1.2][] (2013-07-14)
|
16
18
|
|
17
19
|
- `execute` will now have the filtered version of the values passed
|
18
20
|
to `run` or `run!` as was intended.
|
19
21
|
|
20
|
-
# 0.1.1
|
22
|
+
# [0.1.1][] (2013-07-13)
|
21
23
|
|
22
24
|
- Correct gemspec dependencies on activemodel.
|
23
25
|
|
24
|
-
# 0.1.0
|
26
|
+
# [0.1.0][] (2013-08-12)
|
25
27
|
|
26
28
|
- Initial release.
|
29
|
+
|
30
|
+
[0.2.1]: https://github.com/orgsync/active_interaction/compare/v0.2.0...v0.2.1
|
31
|
+
[0.2.0]: https://github.com/orgsync/active_interaction/compare/v0.1.3...v0.2.0
|
32
|
+
[0.1.3]: https://github.com/orgsync/active_interaction/compare/v0.1.2...v0.1.3
|
33
|
+
[0.1.2]: https://github.com/orgsync/active_interaction/compare/v0.1.1...v0.1.2
|
34
|
+
[0.1.1]: https://github.com/orgsync/active_interaction/compare/v0.1.0...v0.1.1
|
35
|
+
[0.1.0]: https://github.com/orgsync/active_interaction/compare/62f999b...v0.1.0
|
data/README.md
CHANGED
@@ -22,7 +22,7 @@ This project uses [semantic versioning][].
|
|
22
22
|
Add it to your Gemfile:
|
23
23
|
|
24
24
|
```ruby
|
25
|
-
gem 'active_interaction', '~> 0.2.
|
25
|
+
gem 'active_interaction', '~> 0.2.1'
|
26
26
|
```
|
27
27
|
|
28
28
|
And then execute:
|
@@ -174,7 +174,7 @@ end
|
|
174
174
|
```ruby
|
175
175
|
validates :name, length: { maximum: 10 }
|
176
176
|
validates :state, inclusion: { in: %w(AL AK AR ... WY) }
|
177
|
-
validate arrives_before_departs
|
177
|
+
validate :arrives_before_departs
|
178
178
|
|
179
179
|
private
|
180
180
|
|
@@ -143,7 +143,7 @@ module ActiveInteraction
|
|
143
143
|
if options.has_key?(:default)
|
144
144
|
begin
|
145
145
|
default = filter.
|
146
|
-
prepare(attribute, options
|
146
|
+
prepare(attribute, options[:default], options, &block)
|
147
147
|
rescue InvalidValue
|
148
148
|
raise InvalidDefaultValue
|
149
149
|
end
|
@@ -14,13 +14,17 @@ shared_examples_for 'an interaction' do |type, generator, filter_options = {}|
|
|
14
14
|
send(type, :default, filter_options.merge(default: generator.call))
|
15
15
|
send(type, :nil_default,
|
16
16
|
filter_options.merge(allow_nil: true, default: nil))
|
17
|
+
send(type, :defaults_1, :defaults_2,
|
18
|
+
filter_options.merge(default: generator.call))
|
17
19
|
|
18
20
|
def execute
|
19
21
|
{
|
20
22
|
required: required,
|
21
23
|
optional: optional,
|
22
24
|
default: default,
|
23
|
-
nil_default: nil_default
|
25
|
+
nil_default: nil_default,
|
26
|
+
defaults_1: defaults_1,
|
27
|
+
defaults_2: defaults_2
|
24
28
|
}
|
25
29
|
end
|
26
30
|
end
|
@@ -57,6 +61,14 @@ shared_examples_for 'an interaction' do |type, generator, filter_options = {}|
|
|
57
61
|
expect(result[:nil_default]).to be_nil
|
58
62
|
end
|
59
63
|
|
64
|
+
it 'does not return nil for :defaults_1' do
|
65
|
+
expect(result[:defaults_1]).to_not be_nil
|
66
|
+
end
|
67
|
+
|
68
|
+
it 'does not return nil for :defaults_2' do
|
69
|
+
expect(result[:defaults_2]).to_not be_nil
|
70
|
+
end
|
71
|
+
|
60
72
|
context 'with options[:optional]' do
|
61
73
|
let(:optional) { generator.call }
|
62
74
|
|
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: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aaron Lasseigne
|
@@ -9,20 +9,20 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-08-06 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.0.0
|
21
21
|
type: :runtime
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
|
-
- -
|
25
|
+
- - '>='
|
26
26
|
- !ruby/object:Gem::Version
|
27
27
|
version: 3.0.0
|
28
28
|
- !ruby/object:Gem::Dependency
|
@@ -208,17 +208,17 @@ require_paths:
|
|
208
208
|
- lib
|
209
209
|
required_ruby_version: !ruby/object:Gem::Requirement
|
210
210
|
requirements:
|
211
|
-
- -
|
211
|
+
- - '>='
|
212
212
|
- !ruby/object:Gem::Version
|
213
213
|
version: 1.9.3
|
214
214
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
215
215
|
requirements:
|
216
|
-
- -
|
216
|
+
- - '>='
|
217
217
|
- !ruby/object:Gem::Version
|
218
218
|
version: '0'
|
219
219
|
requirements: []
|
220
220
|
rubyforge_project:
|
221
|
-
rubygems_version: 2.0.
|
221
|
+
rubygems_version: 2.0.3
|
222
222
|
signing_key:
|
223
223
|
specification_version: 4
|
224
224
|
summary: Manage application specific business logic.
|