Skip to content

Commit

Permalink
add changelog entry for predicate removal
Browse files Browse the repository at this point in the history
  • Loading branch information
AaronLasseigne committed Jan 10, 2021
1 parent 98f600a commit 8035640
Showing 1 changed file with 37 additions and 9 deletions.
46 changes: 37 additions & 9 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

- drop support for Ruby < 2.5
- drop support for Rails < 5.0
- [#398][] - Predicate methods have been removed.
([how to upgrade](#predicate-methods))
- [#392][] - Integer parsing now defaults the base to 10.
([how to upgrade](#integer-parsing-base-now-10))
- The `inputs` method now returns an `ActiveInteraction::Input` instead of a
Expand All @@ -27,6 +29,40 @@

## Upgrading

### Predicate Methods

We've removed the predicate methods that were automatically generated for each
input. They would return true if an input was not `nil`. They can be manually
replaced with that same check.

```ruby
# v3.8
class Example < ActiveInteraction::Base
string :first_name

validates :first_name,
presence: true,
if: :first_name?

def execute
# ...
end
end

# v4.0
class Example < ActiveInteraction::Base
string :first_name

validates :first_name,
presence: true,
unless: 'first_name.nil?'

def execute
# ...
end
end
```

### Integer Parsing Base Now 10

Integers are parsed using `Integer`. By default this meant that when
Expand Down Expand Up @@ -1056,14 +1092,6 @@ Example.run
[#477]: https://github.com/AaronLasseigne/active_interaction/issues/477
[#476]: https://github.com/AaronLasseigne/active_interaction/issues/476
[#479]: https://github.com/AaronLasseigne/active_interaction/issues/479
<<<<<<< HEAD
<<<<<<< HEAD
[#486]: https://github.com/AaronLasseigne/active_interaction/issues/486
=======
=======
[#392]: https://github.com/AaronLasseigne/active_interaction/issues/392
>>>>>>> dc8b989... default the integer base to 10
>>>>>>> b83ca8a (default the integer base to 10)
=======
[#392]: https://github.com/AaronLasseigne/active_interaction/issues/392
>>>>>>> 2594b86 (remove interface type support from the object and record filters)
[#398]: https://github.com/AaronLasseigne/active_interaction/issues/398

0 comments on commit 8035640

Please sign in to comment.