4.5 KiB
UNRELEASED
-
ActiveModel::Serializable was created it has the shared code between AM::Serializer and AM::ArraySerializer. Basically enable objects to be serializable by implementing an options method to handle the options of the serialization and a serialize method that returns an object to be converted to json by the module. This also removes duplicate code.
6c6bc8872d -
ActiveModel::Serializer::Caching module was created it enables Serializers to be able to cache to_json and serialize calls. This also helps removing duplicate code.
3e27110df7 -
We got rid of the Association.refine method which generated subclasses.
24923722d4 -
Associations doesn't know anymore about the source serializer. That didn't make any sense.
2252e8fe6d
87eadd09b9
79a6e13e8f -
Passing options[:hash] is not public API of include!. That was removed.
5cbf931705 -
ActiveModel::Serializer::Associations::Config is now ActiveModel::Serializer::Association but it's an internal thing so shouldn't bother. ActiveModel::Serializer::Associations::Has* are now ActiveModel::Serializer::Association::Has* and inherit from ActiveModel::Serializer::Association
f5de334ddf
3dd422d99e -
serialize_ids call methods on the corresponding serializer if they are defined, instead of talking directly with the serialized object. Serializers are decorators so we shouldn't talk directly with serialized objects.
-
Array items are not wrapped anymore in root element.
VERSION 0.8.1
- Fix bug whereby a serializer using 'options' would blow up.
VERSION 0.8.0
-
Attributes can now have optional types.
-
A new DefaultSerializer ensures that POROs behave the same way as ActiveModels.
-
If you wish to override ActiveRecord::Base#to_Json, you can now require 'active_record/serializer_override'. We don't recommend you do this, but many users do, so we've left it optional.
-
Fixed a bug where ActionController wouldn't always have MimeResponds.
-
An optinal caching feature allows you to cache JSON & hashes that AMS uses. Adding 'cached true' to your Serializers will turn on this cache.
-
URL helpers used inside of Engines now work properly.
-
Serializers now can filter attributes with
onlyandexcept:UserSerializer.new(user, only: [:first_name, :last_name]) UserSerializer.new(user, except: :first_name) -
Basic Mongoid support. We now include our mixins in the right place.
-
On Ruby 1.8, we now generate an
idmethod that properly serializesidcolumns. See issue #127 for more. -
Add an alias for
scopemethod to be the name of the context. By default this iscurrent_user. The name is automatically set when usingserialization_scopein the controller. -
Pass through serialization options (such as
:include) when a model has no serializer defined.
VERSION 0.7.0
embed_keyoption to allow embedding by attributes other than IDs- Fix rendering nil with custom serializer
- Fix global
self.root = false - Add support for specifying the serializer for an association as a String
- Able to specify keys on the attributes method
- Serializer Reloading via ActiveSupport::DescendantsTracker
- Reduce double map to once; Fixes datamapper eager loading.
VERSION 0.6.0
- Serialize sets properly
- Add root option to ArraySerializer
- Support polymorphic associations
- Support :each_serializer in ArraySerializer
- Add
scopemethod to easily access the scope in the serializer - Fix regression with Rails 3.2.6; add Rails 4 support
- Allow serialization_scope to be disabled with serialization_scope nil
- Array serializer should support pure ruby objects besides serializers
VERSION 0.5.0 (May 16, 2012)
- First tagged version
- Changes generators to always generate an ApplicationSerializer