| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The problem: We need to be able to specify configuration in a way that
can be inherited to models that include ActiveRecord::Model. So it is
no longer sufficient to put 'top level' config on ActiveRecord::Base,
but we do want configuration specified on ActiveRecord::Base and
descendants to continue to work.
So we need something like class_attribute that can be defined on a
module but that is inherited when ActiveRecord::Model is included.
The solution: added ActiveModel::Configuration module which provides a
config_attribute macro. It's a bit specific hence I am not putting this
in Active Support or making it a 'public API' at present.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
namespace."
This reverts commit 8896b4fdc8a543157cdf4dfc378607ebf6c10ab0.
Conflicts:
activemodel/lib/active_model.rb
activemodel/lib/active_model/serializable.rb
activemodel/lib/active_model/serializer.rb
activemodel/test/cases/serializer_test.rb
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The following constants were renamed:
ActiveModel::Serialization => ActiveModel::Serializable
ActiveModel::Serializers::JSON => ActiveModel::Serializable::JSON
ActiveModel::Serializers::Xml => ActiveModel::Serializable::XML
The main motivation for such a change is that `ActiveModel::Serializers::JSON`
was not actually a serializer, but a module that when included allows the target to be serializable to JSON.
With such changes, we were able to clean up the namespace to add true serializers as the ArraySerializer.
|
| |
|
| |
|
| |
|
|
|
|
| |
include the root, but an instance is serialized with the root option passed as true
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
- as_json in ActiveModel should return a hash
and handle :only/:except/:methods options
- Array and Hash should call as_json on their elements
- json methods should not modify options argument
[#5374 state:committed]
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
|
| |
|
|
|
|
| |
for the classes which includes this module
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
[#4515 state:committed]
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
|
|
|
|
| |
3 [DHH]
|
|
|
|
| |
actual serializer
|
| |
|
| |
|
| |
|
| |
|
|
|