| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
| |
|
|
|
|
| |
Remove 4-1 related entries from master [ci skip]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The documentation of `#to_key` (http://api.rubyonrails.org/classes/ActiveModel/Conversion.html#method-i-to_key)
states that it returns `nil` if there are no key attributes. `to_param` needs
to be aware of that fact and return `nil` as well.
Previously it raised the following exception:
```
1) Error:
ConversionTest#test_to_param_returns_nil_if_to_key_is_nil:
NoMethodError: undefined method `join' for nil:NilClass
/Users/senny/Projects/rails/activemodel/lib/active_model/conversion.rb:65:in `to_param'
/Users/senny/Projects/rails/activemodel/test/cases/conversion_test.rb:34:in `block in <class:ConversionTest>'
```
|
| |
|
|
|
|
|
|
| |
Example:
validates_presence_of :name, on: [:update, :custom_validation_context]
|
|
|
|
|
| |
Also improve changelog entries related to secure password to proper
highlight.
|
|
|
|
| |
model.name_changed?(from: "Pete", to: "Ringo")
|
|
|
|
|
|
|
|
|
|
|
|
| |
Extract **notable changes**, **deprecations** and **removals** from
each CHANGELOG.
I tried to reference the commits and pull requests for new features
and deprecations.
In the process I also made some minor changes to the CHANGELOGS.
The 4_1_release_notes guide is declared WIP.
|
|
|
|
|
|
|
|
| |
See:
- https://github.com/codahale/bcrypt-ruby/pull/63
- https://github.com/codahale/bcrypt-ruby/pull/64
- https://github.com/codahale/bcrypt-ruby/pull/65
|
|\
| |
| |
| |
| |
| |
| | |
Updated DirtyModel's @changed_attributes hash to be symbol/string agnostic
Conflicts:
activemodel/CHANGELOG.md
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
of an instance. When using the attribute_will_change! method, you must
supply a string and not a symbol or the *_changed? method will break
(because it is looking for the attribute name as a string in the keys
of the underlying hash). To remedy this, I simply made the underlying
hash a HashWithIndifferentAccess so it won't matter if you supply
the attribute name as a symbol or string to attribute_will_change!.
|
| |
| |
| |
| | |
[ci skip]
|
| |
| |
| |
| | |
Make AM::Dirty less dirty to plugin into AR or other library
|
| | |
|
|\ \
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
chuckbergeron/validates-inclusion-of-accuracy-for-non-numeric-ranges
Greater accuracy for validates_inclusion_of on non-numeric ranges
Closes #10774, fixes #10593
|
| | |
| | |
| | |
| | |
| | |
| | | |
Range#include? for non-numeric ranges
added changelog message
|
|/ /
| |
| |
| | |
If the confirmation was blank, but the password wasn't, it would still save.
|
| |
| |
| |
| | |
their setup in their constructor now.
|
| | |
|
| | |
|
| |
| |
| |
| | |
Add a working example of how to use this new method.
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| | |
it only cleared the validations that created :validate callbacks. This
didn't include the validates created by validates_with, so I've added a
method to clear all validations.
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Closes #9535.
With 692b3b6 the `password=` setter does no longer set blank passwords.
This triggered validation errors when assigning empty Strings to `password`
and `password_confirmation`.
This patch only sets the confirmation if it is not `blank?`.
|
| | |
|
| | |
|
| | |
|
|/ |
|
|
|
|
| |
[ci skip]
|
| |
|
| |
|
|
|
|
| |
Also some minor improvements to other changelogs. [ci skip]
|
| |
|
|
|
|
|
|
| |
absence of attributes.
Add `ActiveModel::Errors#add_on_present` method. Adds error messages to present attributes.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
When resetting an attribute, you expect it to return to the state it was
before any changes. Namely, this fixes this unexpected behavior:
~~~ruby
model.name = "Bob"
model.reset_name!
model.name_changed? #=> true
~~~
|
|
|
|
| |
[ci skip]
|
|
|
|
|
|
|
|
|
|
|
|
| |
When serialising a class, specify the type of any singular associations, if
necessary. Rails already correctly specifies the :type of any enumerable
association (e.g. a has_many association), but made no attempt to do so for
non-enumerables (e.g. a has_one association).
We must specify the :type of any STI association. A has_one
association to a class which uses single-table inheritance is an example of
this type of association.
Fixes #7471
|
|\
| |
| |
| |
| |
| |
| | |
Length validation handles correctly nil. Fix #7180
Conflicts:
activemodel/CHANGELOG.md
|
| |
| |
| |
| | |
When nil or empty string are not allowed, they are not valid.
|
|/ |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This reverts commit 4e9f53f9736544f070e75e516c71137b7eb49a7a, reversing
changes made to 6b802cdb4f5b84e1bf49aaeb0e994b3be6028af9.
Revert "Don't use tap in this case."
This reverts commit 454d820bf0a18fe1db4c55b0145197d70fef1f82.
Reason: Is not a good idea to add options to this method since we can do
the same thing using method composition.
Person.validators_on(:name).select { |v| v.kind == :presence }
Also it avoids to change the method again to add more options.
|
|
|
|
|
| |
This will filter out the validators on a particular attribute based on
its kind.
|