| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
|
|
|
|
| |
I also attempted to fix other styleguide violations such as
{ a: :b } over {a: :b} and foo(b: 'bar') over foo( b: 'bar' ).
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Due to a change in builder, nil values and empty strings now generates
closed tags, so instead of this:
<pseudonyms nil=\"true\"></pseudonyms>
It generates this:
<pseudonyms nil=\"true\"/>
Document this change in Rails so that people can track it down easily if
necessary.
|
|
|
|
|
|
|
|
|
|
|
| |
https://github.com/rails/rails/issues/6958
- Enable propagation of :skip_types, :dasherize and :camelize on included models by default
- Adding the option to override this propagation on a per-include basis (:include => { :model => { :dasherize => false } }
- Enough tests to prove it works
- Updated activemodel CHANGELOG.md
Squashed my commits
|
|
|
|
|
|
| |
ActiveRecord json/xml serialization should use as base
serializable_hash, provided by ActiveModel. Add some more coverage
around options :only and :except for both json and xml serialization.
|
|
|
|
|
|
|
|
|
| |
XmlMini define the xml 'datatime', but according to
http://www.w3.org/TR/xmlschema-2/#dateTime could be better
change this to 'dateTime' with upper case letter 'T.
So 'DateTime' and 'Time' are redefined from 'datetime' to 'dateTime'
add the changing to the changelog
|
|
|
|
| |
collection-thing.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit moves support for the :include serialization option for
serializing associated objects out of ActiveRecord in into ActiveModel.
The following methods support the :include option:
* serializable_hash
* to_json
* to_xml
Instances must respond to methods named by the values of the :includes
array (or keys of the :includes hash). If an association method returns
an object that is_a?(Enumerable) (which AR has_many associations do), it
is assumed to be a collection association, and its elements must respond
to :serializable_hash. Otherwise it must respond to :serializable_hash
itself.
While here, fix #858, XmlSerializer should not singularize already
singular association names.
|
|
|
|
| |
serialization options. Closes #1058
|
| |
|
|
Hopefully "serializeration" is not an in joke that I missed.
|