Santiago Pastorino
841f3b8181
Add filter to allow users implement filter method to include/exclude attributes and relations
2013-10-18 17:49:20 -02:00
Santiago Pastorino
f6ea07dd22
Do not convert attrs to String until needed
2013-10-18 17:49:20 -02:00
Santiago Pastorino
daa9304398
Do not convert root and meta_key to Strings
2013-10-18 17:49:20 -02:00
Santiago Pastorino
75e9a2599d
Store attributes as they are instead of converting them into Strings
2013-10-18 17:49:20 -02:00
Santiago Pastorino
10e882a14f
Allow to set embed options from AM::Serializer
2013-10-18 17:49:20 -02:00
Santiago Pastorino
aa23e811cc
Use controller name as root when serializing an array and not root is defined
2013-10-18 17:49:20 -02:00
Santiago Pastorino
86b9d5a226
Avoid work inside serializable_array
2013-10-18 17:49:20 -02:00
Santiago Pastorino
8006529e20
Allow ArraySerializer to pass the options down to item serializers
2013-10-18 17:49:19 -02:00
Santiago Pastorino
6f3503c965
Use serializer name as root when root not set
2013-10-18 17:49:19 -02:00
Santiago Pastorino
626a85bc3e
Allow using root = false in initialize
2013-10-18 17:49:19 -02:00
Santiago Pastorino
8462a73f3a
Make render json work when not using AMS
2013-10-18 17:49:19 -02:00
Santiago Pastorino
7405baafd7
Serialize associations that doesn't have an associated serializer
2013-10-18 17:49:19 -02:00
Santiago Pastorino
513e7f2166
Add setup method and Setting object to configure AMS
2013-10-18 17:49:19 -02:00
Santiago Pastorino
29148cbe1c
Add AC::Serialization#serialization_scope as a class level method
2013-10-18 17:49:19 -02:00
Santiago Pastorino
0e0341effc
Implement embed in root
2013-10-18 17:49:19 -02:00
Santiago Pastorino
af34adc7b5
Move key's initialization code to initializers
2013-10-18 17:49:19 -02:00
Santiago Pastorino
280fd65db8
Allow to set key for associations through options
2013-10-18 17:49:19 -02:00
Santiago Pastorino
48590a2e37
Allow to set root for associations through options
2013-10-18 17:49:19 -02:00
Santiago Pastorino
8a495b1d00
Embedded has_one returns an array with the key pluralized
2013-10-18 17:49:19 -02:00
Santiago Pastorino
3fcd8c5f98
Define root and root= as aliases of _root=
2013-10-18 17:49:18 -02:00
Santiago Pastorino
7ba05c02e3
Make Serializable module which implements as_json
2013-10-18 17:49:18 -02:00
Santiago Pastorino
e6993c677b
Add missing requires
2013-10-18 17:49:18 -02:00
Santiago Pastorino
a820e9774f
Add ArraySerializer's root and meta features
2013-10-18 17:49:18 -02:00
Santiago Pastorino
70ea6c6bc7
Add has_one and has_many :serialize => tests
2013-10-18 17:49:18 -02:00
Santiago Pastorino
f647b7ae74
Implement each_serializer
2013-10-18 17:49:18 -02:00
Santiago Pastorino
7e83f0c29d
Implement ArraySerializer
2013-10-18 17:49:18 -02:00
Santiago Pastorino
61a1669a86
Implement has_many
2013-10-18 17:49:18 -02:00
Santiago Pastorino
516f5bdceb
Implement has_one's embed ids include true
2013-10-18 17:49:18 -02:00
Santiago Pastorino
52bb3f6929
Implement has_one's embed objects
2013-10-18 17:49:17 -02:00
Santiago Pastorino
d756ae4a70
Implement has_one's and serialize_ids
2013-10-18 17:49:17 -02:00
Santiago Pastorino
01bc534976
Remove SerializerSupport
2013-10-18 17:49:17 -02:00
Santiago Pastorino
0d4dfb69a9
Fix directories the project is on top level dir
2013-10-18 17:49:17 -02:00
Santiago Pastorino
0c91564101
Remove method redefined warning
2013-10-18 17:49:17 -02:00
Santiago Pastorino
9e75625b1f
Re-order properties
2013-10-18 17:49:17 -02:00
Santiago Pastorino
93baaa96b1
Implement meta and meta_key for AM::Serializer
2013-10-18 17:49:17 -02:00
Santiago Pastorino
af357619c1
Add AMS support to AR objects
2013-10-18 17:49:17 -02:00
Santiago Pastorino
0d3b56e9cf
Implement AC integration
2013-10-18 17:49:17 -02:00
Santiago Pastorino
d41e5ccef7
Implement SerializerSupport class
2013-10-18 17:49:17 -02:00
Santiago Pastorino
b6f9c5ee43
Implement Serializer's scope
2013-10-18 17:49:16 -02:00
Santiago Pastorino
c3f857d1b6
Implement Serializer's root
2013-10-18 17:49:16 -02:00
Santiago Pastorino
7143eb8301
Serialize just attributes
2013-10-18 17:49:16 -02:00
Santiago Pastorino
14f51f2ea9
Remove everything, rewrite of AMS starts here
2013-10-18 17:46:18 -02:00
Tee Parham
31e1dab69f
require rails >= 3.2
...
* remove ancient confusing comment in SerializerGenerator
2013-05-30 15:26:17 -06:00
Tee Parham
74ba9dc76c
upgrade hash syntax
2013-05-30 15:25:06 -06:00
Tee Parham
143e5d9866
do not generate id method (was for 1.8 only)
...
see https://github.com/rails-api/active_model_serializers/issues/127
for original motivation
2013-05-29 19:39:00 -06:00
Santiago Pastorino
c97acfd9ba
Always set a serializer for each item of an Array
...
model.active_model_serializer could return nil so we need to ensure that
if serializer is not setted we set DefaultSerializer to it.
This reverts commit 64ed05c484 .
Fixes #318
2013-05-28 18:13:07 -07:00
Santiago Pastorino
f68003f64d
Merge pull request #313 from geigerzaehler/fix_root
...
Don't wrap array items in root element
2013-05-24 14:49:41 -07:00
Santiago Pastorino
9521e912fe
serialize_ids call methods on the corresponding serializer if defined
2013-05-24 14:09:27 -07:00
Thomas Scholtes
258248d6c0
Don't wrap array items in root element
2013-05-24 10:23:59 +02:00
Santiago Pastorino
ee846f39af
Fix build in 1.8.7
2013-05-22 14:24:22 -07:00