| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
| |
Any tests for a type which is not overridden by Active Record, and does
not test the specifics of the attributes API interacting in more complex
ways have no reason to be in the Active Record suite. Doing this
revealed that the implementation of the date and time types in AM was
actually completely broken, and incapable of returning any value other
than `nil`.
|
| |
|
| |
|
|
|
|
|
|
| |
As far as I can tell, the original reason that this behavior was added
has been sufficiently resolved elsewhere, as we no longer remove the
encoding of strings coming out of the database.
|
|
|
|
| |
Fixes #18580.
|
|
|
|
|
|
|
|
| |
Before this change we had a small set of "truthy", and all others
are "falsy".
Now, we have a small set of "falsy" values and all others are
"truthy" matching Ruby's semantics.
|
|
|
|
|
| |
We had accidentally gone one power of two too far. In addition, we need
to handle minimum values as well as the maximum.
|
|
|
|
|
|
|
|
|
|
|
| |
In Rails 5.0, we'd like to change the behavior of boolean columns in
Rails to be closer to Ruby's semantics. Currently we have a small set
of values which are "truthy", and all others are "falsy". In Rails 5.0,
we will reverse this to have a small number of values which are "falsy",
and all others will become "truthy".
In the interim, all values which are ambiguous must emit a deprecation
warning.
|
|
|
|
|
| |
This was a small self contained piece of the refactoring that I am
working on, which required these objects to be comparable.
|
| |
|
| |
|
| |
|
|\
| |
| |
| | |
Detect in-place modifications on Strings
|
| | |
|
|/
|
|
|
|
|
|
| |
We previously only did this if the old value was zero, to make sure
numericality validations run and failed if the user gave 'wibble' as the
value, which would be type cast to 0. However, numericality validations
will fail if there are any non-numeric characters in the string, so 5 ->
'5wibble' should also be marked as changed.
|
|
|
|
|
|
|
|
| |
In some cases there is a difference between the two, we should always
be doing one or the other. For convenience, `type_cast` is still a
private method on type, so new types that do not need different behavior
don't need to implement two methods, but it has been moved to private so
it cannot be used accidentally.
|
|
|
|
|
|
| |
There's no longer type casting behavior of any kind inside of `Column`
for the general case. These tests can be made clearer by testing the
type objects directly.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This reverts commit f936a1f100e75082081e782e5cceb272885c2df7.
Conflicts:
activerecord/lib/active_record.rb
activerecord/lib/active_record/base.rb
Revert "Fixed: #without_typecast should only disable typecasting on the duplicated attributes" [#3387 state:open]
This reverts commit 2831996483c6a045f1f38d8030256eb58d9771c3.
Reason :
It's not generating attribute methods properly, making object.column 5x slower.
|
|
Signed-off-by: Joshua Peek <josh@joshpeek.com>
|