| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The functionality has not changed, but the code is more elegant by
using `reduce` instead of `each`.
This way no accumulator needs to be declared, no explicit return is
needed.
|
|/ / |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
If the request parameters are passed to create_with and where they can
be used to do mass assignment when used in combination with
Relation#create.
Fixes CVE-2014-3514
Conflicts:
activerecord/lib/active_record/relation/query_methods.rb
|
| | |
|
|\ \
| | |
| | |
| | | |
Use #model_name on instances instead of classes
|
| | |
| | |
| | |
| | |
| | |
| | | |
This allows rails code to be more confdent when asking for a model name, instead of having to ask for the class.
Rails core discussion here: https://groups.google.com/forum/#!topic/rubyonrails-core/ThSaXw9y1F8
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
WARNING: don't use them! They might change or go away between future beta/RC/
patch releases!
Also added a CHANGELOG entry for this.
|
| | | |
|
| |/
|/| |
|
| | |
|
| |
| |
| |
| |
| | |
We have to specify the `:title` option to really use the
`TitleValidator` defined above.
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This change prevents a certain class of user error which results when
mistakenly using the `validate` class method instead of the `validates`
class method.
Only apply when all arguments are symbols, because some validations use
the `validate` method and pass in additional options, namely the
`LenghValidator` via the `ActiveMode::Validations::validates_with`
method.
|
| |
| |
| |
| |
| |
| |
| | |
Also make it accept a list of attributes to be changed. This will make
possible to restore only a subset of the changed attributes.
Closes #16203
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
These methods may cause confusion with the `reset_changes` that
behaves differently
of them.
Also rename undo_changes to restore_changes to match this new set of
methods.
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
#clear_changes_information
This method name is causing confusion with the `reset_#{attribute}`
methods. While `reset_name` set the value of the name attribute for the
previous value the `reset_changes` only discard the changes and previous
changes.
|
| | |
|
| |
| |
| |
| | |
This is a follow up to #16024.
|
| |
| |
| |
| | |
ActiveModel::SecurePassword
|
| |
| |
| |
| |
| | |
The instance method `model_name` was being defined multiple times,
causing a redefinition warning.
|
| |
| |
| |
| | |
To avoid overload with database rollback
|
| | |
|
|\ \
| | |
| | |
| | | |
Added rollback method to ActiveModel::Dirty
|
| | | |
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Leave the note for `ActiveModel`, since it can't yet detect mutations
(hopefully we can change this in time for 4.2). However, we now detect
mutations on all supported types in `ActiveRecord`, so we can note that
`_will_change!` is no longer needed there.
|
|\ \ \
| |_|/
|/| | |
Allow proc and symbol as values for `only_integer` of `NumericalityValidator`
|
| | | |
|
|/ / |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| | |
See #14591, Reason - BCrypt hash function can handle maximum 72 characters.
|
|\ \
| | |
| | | |
[ci skip] Clarify ActiveModel::Model docs
|
| | |
| | |
| | |
| | | |
ActiveModel attributes initialized with String return String values
|
|/ / |
|
| | |
|
| | |
|
| | |
|
|\ \
| | |
| | | |
Put attr_reader in with all of the other instance methods
|
| | |
| | |
| | |
| | | |
This makes the grouping make a little more sense
|
|/ /
| |
| |
| | |
[ci skip]
|
|/ |
|
|
|
|
|
|
| |
Currently, if environment doesn’t eager load code, invoking this
constant before calling #valid? on a model instance results in a
NameError.
|
| |
|
|
|
| |
[ci skip]
|
|
|
|
|
|
|
|
| |
It's unintuitive to call '#valid?' when you want to run validations but
don't care about the return value.
The alias in ActiveRecord isn't strictly necessary (the ActiveModel
alias is still in effect), but it clarifies.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This method return `Gem::Version.new(Rails.version)`, suggesting a more
reliable way to perform version comparison.
Example:
Rails.version #=> "4.1.2"
Rails.gem_version #=> #<Gem::Version "4.1.2">
Rails.version > "4.1.10" #=> false
Rails.gem_version > Gem::Version.new("4.1.10") #=> true
Gem::Requirement.new("~> 4.1.2") =~ Rails.gem_version #=> true
This was originally introduced as `.version` by @charliesome in #8501
but got reverted in #10002 since it was not backward compatible.
Also, updating template for `rake update_versions`.
|
|
|
|
|
|
|
|
| |
Now that Validator #setup is called from the initializer, we need a
reference to the model's class to be passed in to allow the validators
to continue functioning when used at the instance level.
Closes #14134.
|