| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
| |
Using heredoc would enforce line wrapping to whatever column width we decided to
use in the code, making it difficult for the users to read on some consoles.
This does make the source code read slightly worse and a bit more error-prone,
but this seems like a fair price to pay since the primary purpose for these
messages are for the users to read and the code will not stick around for too
long.
|
|
|
|
|
|
|
| |
This reverts commit 6f3c64eeb1dc8288dae49f114aaf619adc7dcb7f.
Conflicts:
activerecord/CHANGELOG.md
|
|
|
|
|
|
| |
This reverts commit a03097759bd7103bb9db253e7ba095f011453f75.
This needs more work before it would work correctly on master.
|
|
|
|
|
|
|
|
| |
Fixed issue with ActiveRecord serialize object as JSON
Conflicts:
activerecord/CHANGELOG.md
activerecord/lib/active_record/attribute_methods/serialization.rb
|
|
|
|
| |
to "without replacement"
|
|
|
|
|
| |
We've stopped using it internally, in favor of polymorphism. So should
you!
|
|
|
|
|
|
| |
We have several mutable types on Active Record now. (Serialized, JSON,
HStore). We need to be able to detect if these have been modified in
place.
|
|
|
|
|
|
| |
We need to decorate the types lazily. This is extracted to a separate
API, as there are other refactorings that will be able to make use of
it, and to allow unit testing the finer points more granularly.
|
|
|
|
|
| |
The types know more about what is going on than the dirty module. Let's
ask them!
|
|
|
|
|
|
|
|
|
|
|
| |
Nearly completely implemented in terms of custom properties.
`_before_type_cast` now stores the raw serialized string consistently,
which removes the need to keep track of "state". The following is now
consistently true:
- `model.serialized == model.reload.serialized`
- A model can be dumped and loaded infinitely without changing
- A model can be saved and reloaded infinitely without changing
|
|
|
|
|
|
| |
During `init_with`, the attributes given to the coder will be placed
into `@raw_attributes`. As such, we should read from `@raw_attributes`
when encoding, rather than `@attributes`, which has been type cast.
|
|
|
|
|
|
|
|
|
| |
`@attributes` was actually used for `_before_type_cast` and friends,
while `@attributes_cache` is the type cast version (and caching is the
wrong word there, but I'm working on removing the conditionals around
that). I opted for `@raw_attributes`, because `_before_type_cast` is
also semantically misleading. The values in said hash are in the state
given by the form builder or database, so raw seemed to be a good word.
|
| |
|
|
|
|
|
|
|
| |
Many of the methods defined in `AttributeMethods::Serialization` can be
refactored onto this type as well, but this is a reasonable small step.
Removes the `Type` class, and the need for `decorate_columns` to handle
serialized types.
|
|
|
|
|
| |
Adds the ability to save custom types, which type cast to non-primitive
ruby objects.
|
|\
| |
| |
| |
| |
| |
| | |
Fix serialized field returning serialized data after update_column
Conflicts:
activerecord/CHANGELOG.md
|
| | |
|
|/
|
|
|
|
|
|
| |
The second argument to serialize has double meaning:
* `class_name` of the Type to serialize
* `coder` to use then serializing.
The new variable name and the docs better describe that behavior.
|
| |
|
|
|
|
| |
after loading it from YAML - fixes #13861
|
|
|
| |
Move serialization dirty into serialization.rb
|
|\ |
|
| |
| |
| |
| | |
See #8328
|
|/
|
|
|
|
| |
This is necessary because as of 5ac2341 `hstore` columns are always stored
as `Hash` with `String` keys. `ActiveRecord::Store` expected the attribute to
be an instance of `HashWithIndifferentAccess`, which led to the bug.
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
Fix #8575
|
|
|
|
| |
We should not need any `serialized_attributes` checks outside `ActiveRecord::AttributeMethods::Serialization` module.
|
|
|
|
| |
Public method `attributes_before_type_cast` used to return internal AR structure (ActiveRecord::AttributeMethods::Serialization::Attribute), patch fixes this. Now behaves like `read_attribute_before_type_cast` and returns unserialised values.
|
| |
|
|
|
|
| |
It's sometimes hard to quickly find where deprecated call was performed, especially in case of migrating between Rails versions. So this is an attempt to improve the call stack part of the warning message by providing caller explicitly.
|
|\
| |
| |
| |
| | |
Conflicts:
actionpack/lib/action_view/helpers/asset_tag_helper.rb
|
| | |
|
|/ |
|
| |
|
| |
|
|
|
|
| |
Those z's were hard to type.
|
| |
|
|
|
|
|
| |
Get rid of ActiveModel::Configuration, make better use of
ActiveSupport::Concern + class_attribute, etc.
|
| |
|
| |
|
|\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* master: (30 commits)
Bump tzinfo. 0.3.31 was released on November 6, 2011.
Fix GH #4909. Dependency on TZInfo move from AR to AS.
moving ordered hash to normal hash because ruby 1.9.3 hash defaultly ordered one
Refactored the OrderedHash related stuff
Replaced OrderedHash usage with Ruby 1.9 Hash
Replaced OrderedHash with Hash for ruby 1.9 series
removed unnecessary code
replacing the orderhash with hash for ruby-1.9
Clean up some wording.
Fix typo.
test title changed corresponding to the test
replaced active support ordered hash to ruby hash on active resource
PostgreSQL does not work in the same way of the other adapters
AR::Relation#pluck: improve to work with joins
Fix match docs
Fix attribute_before_type_cast for serialized attributes. Fixes #4837.
Fix failing request test
Fixes in AMo README
Update README to mention lint.
Trim down Active Model API by removing valid? and errors.full_messages
...
|
| | |
|
| | |
|
| | |
|
| | |
|
|/
|
|
| |
looked up on the instance
|