Skip to content

Commit

Permalink
Merge branch 'master' into v0.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
AaronLasseigne committed Aug 6, 2013
2 parents 678e0ee + f070e5c commit 5eb8207
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 9 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
- Use default value when given an explicit `nil`.
- Allow nested default values.

# [0.2.1][] (2013-08-06)

- Fix setting a default value on more than one attribute at a time.

# [0.2.0][] (2013-07-16)

- Wrap interactions in ActiveRecord transactions if they're available.
Expand All @@ -28,7 +32,8 @@

- Initial release.

[master]: https://github.com/orgsync/active_interaction/compare/v0.2.0...master
[master]: https://github.com/orgsync/active_interaction/compare/v0.2.1...master
[0.2.1]: https://github.com/orgsync/active_interaction/compare/v0.2.0...v0.2.1
[0.2.0]: https://github.com/orgsync/active_interaction/compare/v0.1.3...v0.2.0
[0.1.3]: https://github.com/orgsync/active_interaction/compare/v0.1.2...v0.1.3
[0.1.2]: https://github.com/orgsync/active_interaction/compare/v0.1.1...v0.1.2
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ This project uses [semantic versioning][].
Add it to your Gemfile:

```ruby
gem 'active_interaction', '~> 0.2.0'
gem 'active_interaction', '~> 0.2.1'
```

And then execute:
Expand Down
2 changes: 1 addition & 1 deletion lib/active_interaction/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module ActiveInteraction
VERSION = Gem::Version.new('0.2.0')
VERSION = Gem::Version.new('0.2.1')
end
19 changes: 13 additions & 6 deletions spec/support/interactions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,17 @@
send(type, :default, filter_options.merge(default: generator.call))
send(type, :nil_default,
filter_options.merge(allow_nil: true, default: nil))
send(type, :multi_default_1, :multi_default_2, filter_options.merge(default: generator.call))
send(type, :defaults_1, :defaults_2,
filter_options.merge(default: generator.call))

def execute
{
required: required,
optional: optional,
default: default,
nil_default: nil_default
nil_default: nil_default,
defaults_1: defaults_1,
defaults_2: defaults_2
}
end
end
Expand Down Expand Up @@ -63,6 +66,14 @@ def execute
expect(result[:nil_default]).to be_nil
end

it 'does not return nil for :defaults_1' do
expect(result[:defaults_1]).to_not be_nil
end

it 'does not return nil for :defaults_2' do
expect(result[:defaults_2]).to_not be_nil
end

context 'with options[:optional]' do
let(:optional) { generator.call }

Expand All @@ -81,10 +92,6 @@ def execute
it 'returns the correct value for :default' do
expect(result[:default]).to eq default
end

it 'sets the default on multiple attributes' do
expect(outcome).to be_valid
end
end
end
end

0 comments on commit 5eb8207

Please sign in to comment.