Santiago Pastorino
0917148617
serialize_ids doesn't use source serializer and it's object
2013-05-21 17:03:06 -07:00
Santiago Pastorino
9f5e872621
Extract id_key to a method
2013-05-21 17:03:06 -07:00
Santiago Pastorino
a41de0286f
Passing options[:hash] is not public API of include!
2013-05-21 17:03:06 -07:00
Santiago Pastorino
ea3566955c
Remove option method just use the reader
2013-05-21 17:03:06 -07:00
Santiago Pastorino
5017fb686a
Associations doesn't depend on source serializer anymore
2013-05-21 17:03:06 -07:00
Santiago Pastorino
460a250984
Get rid of refine
2013-05-21 17:03:06 -07:00
Santiago Pastorino
1a8709d71c
Move caching to a new module
2013-05-21 17:03:06 -07:00
Santiago Pastorino
f179a27ed7
Add docs to serializable
2013-05-21 17:03:06 -07:00
Santiago Pastorino
aaa08c25ef
Make include_meta and meta_key private
2013-05-21 17:03:06 -07:00
Santiago Pastorino
76fead041f
Make Serializer reuse Serializable
2013-05-21 17:03:06 -07:00
Santiago Pastorino
0e876624ec
Move reusable code to a module
2013-05-21 17:03:05 -07:00
Santiago Pastorino
64ed05c484
Define serializer as DefaultSerializer if not set
2013-05-21 17:03:05 -07:00
Steve Klabnik
fe84e0ad52
version bump 0.8.1
2013-05-05 17:35:51 -07:00
Sam
597a2e3148
allow serializers to implement an options attribute
2013-05-06 10:30:46 +10:00
Steve Klabnik
a022d464f5
Bump to 0.8.0
2013-05-05 13:45:50 -07:00
Steve Klabnik
bb8900e308
Merge pull request #264 from vad4msiu/features/root_element
...
Support for setting root element
2013-05-05 12:02:27 -07:00
Steve Klabnik
cffdbce072
Merge pull request #283 from morgoth/add-only-and-except-options-support
...
Add only and except options support
2013-05-05 12:00:59 -07:00
Gosha Arinich
e8ae3e1bb3
allow singular embed when serializing association
...
Having
```ruby
has_one :post, embed: :ids
```
looks especially weird as it's a one-to-one association, hence there is
only one id. The following looks better:
```ruby
has_one :post, embed: :id
```
2013-05-05 11:02:42 +03:00
Wojciech Wnętrzak
489ebf2132
Added support for :only and :except methods.
...
It is possible now to filter returned attributes and associations by:
UserSerializer.new(user, only: [:first_name, :last_name])
UserSerializer.new(user, except: :first_name)
2013-04-27 21:29:26 +02:00
Wojciech Wnętrzak
82f50ef81f
Unify way of calling include_attribute? in attibutes and association methods.
2013-04-20 23:28:33 +02:00
Jason Kriss
4e762ee8b5
fix a couple typos
2013-04-18 13:39:14 -07:00
Steve Klabnik
c1dacccbdc
Merge pull request #273 from seanabrahams/embed-ids-not-using-local-method
...
Fixes #267
2013-04-15 17:44:06 -07:00
Sean Abrahams
79acd87829
Use method instead of asssociation_ids if method exists. Fixes #267
2013-04-10 14:38:53 -07:00
vanstee
a900d31041
Support strings as attribute names
...
When generating the `_fast_attributes` method, attribute names that
could not be represented as symbols (at least without escaping) would
throw parsing errors.
2013-04-09 00:53:56 -04:00
vad4msiu
95081410d2
Support for setting root element
2013-04-04 15:10:29 +04:00
Steve Klabnik
9551a97464
Revert 37b0690fb8.
...
This feature causes more problems than it solves.
2013-04-03 17:24:08 -07:00
Prathamesh Sonpatki
75a72b5cc9
Fixed few typos
2013-03-26 20:29:35 +05:30
Prathamesh Sonpatki
7d1ce9c56e
Fixed typos
2013-03-26 18:18:20 +05:30
Kevin Mahoney
2bd447d69d
Pass options through when using default serializer
2013-03-22 13:12:33 +00:00
Steve Klabnik
680e2efbec
Merge pull request #246 from beerlington/dry-option-setup
...
Refactor and consolidate serializer option setup
2013-03-20 08:56:54 -07:00
beerlington
e4ad25073d
Adding doc for build_json method
2013-03-20 08:14:23 -04:00
beerlington
fd578fcf69
Refactor and consolidate serializer option setup
2013-03-19 22:21:41 -04:00
Sam
af13d48dfa
improved caching of root node for better performance
2013-03-18 16:21:34 -07:00
beerlington
4a13f86961
Reference scope by same name as serialization scope
...
By default, the serialization scope uses current_user, and you can
now reference the scope as "current_user" in the serializer. If you
override the scope using "serialization_scope" in your controller,
it will use that method name instead.
2013-03-18 14:44:38 -04:00
Sam
ad1d34b2c4
Fix inheritance issues, poison cache if attributes change
2013-03-16 03:45:06 -07:00
Steve Klabnik
746a63ab09
Merge pull request #89 from twinturbo/caching
...
Serializers Cache JSON & Hashes
2013-03-15 10:30:04 -07:00
Tony Pitale
d3c6596990
make sure to merge the original responder options into the given options to preserve location
2013-03-15 03:54:35 -04:00
twinturbo
c3966fe741
ArraySerializer is also cached
2013-03-14 22:54:05 +01:00
twinturbo
bd90af0e49
Remove commented code
2013-03-14 22:41:34 +01:00
twinturbo
b854d49298
Rebase against master
2013-03-14 22:40:46 +01:00
twinturbo
e3888f0a40
Clean up interface inconistency
2013-03-14 22:40:06 +01:00
twinturbo
535a33a33b
Have to opt in with #cache_key
2013-03-14 22:40:06 +01:00
twinturbo
e923174a26
#cache_key delegates to #object by default
2013-03-14 22:40:06 +01:00
twinturbo
b4395f281b
Add basic caching
2013-03-14 22:40:06 +01:00
Steve Klabnik
6408b73e3c
Merge pull request #233 from SamSaffron/fix
...
Optimised performance for attribute extraction
2013-03-14 14:22:27 -07:00
Sam
710c375088
remove safe guard per discussion with steveklabnik
2013-03-14 14:11:04 -07:00
Sam
08a182d743
per discussion remove instrumentation altogether
2013-03-13 22:18:40 -07:00
Sam
31ba6fbb08
Optimised performance for attribute extraction
...
Disabled all instrumentation unless enabled explicitly
2013-03-13 21:20:56 -07:00
Michael Rykov
37b0690fb8
Add a Responder to handle respond_with(resource)
2013-03-13 16:45:23 -07:00
Steve Klabnik
f4916f113f
Merge pull request #223 from tchak/id-serialization-with-hooks
...
use `read_attribute_for_serialization` to serialize ids
2013-03-08 09:17:19 -08:00