Santiago Pastorino
5c00ce0443
Merge pull request #451 from plexus/embed_in_root_merge
...
embed_in_root only returns the associated objects of a single instance
2013-12-16 10:39:53 -08:00
Santiago Pastorino
2faa571a9c
Do not allo ruby-head failures
2013-12-06 15:33:08 -02:00
Santiago Pastorino
ac0ce8dcf9
Use jruby and rbx in Travis
2013-12-06 15:26:38 -02:00
Arthur Neves
3a9475a168
Ruby-head and fast_finish
2013-12-03 22:55:29 -05:00
Arthur Neves
ddaf09a099
Alow rbx to fail
2013-12-03 22:53:37 -05:00
Santiago Pastorino
39b2a2bdf4
Update Rubinius to 2.2.1
2013-11-28 15:47:30 -03:00
Santiago Pastorino
c65ac37152
Merge pull request #453 from jasontruluck/master
...
Add @options back into serializers for passing custom options
2013-11-28 10:38:41 -08:00
Jason Truluck
a110df6caf
Add @options back into serializers to maintain the functionality of render :json as noted in the docs
...
This functionality used to exist in v0.8.1. This adds the ability to
pass other options that will be usable in the serializer via the
options accessor.
This works by adding an attr_accessor for options so it is available
and is set by the remaining options in the provided options hash during
initialization.
2013-11-12 12:57:31 -05:00
Arne Brasseur
1db96ec7a9
When using embed: :ids ; embed_in_root: true, and serializing multiple objects,
...
only the associated objects of the last object in the collection will actually
show up in the serialized data.
For example, if you serialize a collection of two posts, each containing one or
more comments, only the comments of the last post show up. The reason is a
Hash#merge wich overwrites the array rather than appending to it.
This commit fixes this by merging the collection arrays, rather than the top-level
hashes.
2013-11-11 14:30:34 +01:00
Rafael Mendonça França
127413ffde
Merge pull request #445 from todd/fix-controller-scaffold-generator
...
Fixed Rails 4 Controller Scaffold Generator.
2013-11-06 12:43:23 -08:00
Todd Bealmear
6f04f86ae5
Fixed test for Rails versions prior to 4
2013-11-05 10:42:55 -08:00
Todd Bealmear
e0a564aa68
Fixed Rails 3 compatibility.
2013-11-04 17:45:36 -08:00
Todd Bealmear
f10f72c763
Fixed Rails 4 Controller Scaffold Generator.
2013-11-04 17:31:19 -08:00
Santiago Pastorino
99677c0c58
Pass scope through to associations via @lastobelus
...
Closes #433
2013-11-04 10:48:19 -02:00
Santiago Pastorino
60b5901af8
Don't treat has_one associations embed objects as an array
...
Closes #442
Thanks @arrtchiu for reporing and giving a test case
2013-11-04 10:09:29 -02:00
Santiago Pastorino
f2bfddd805
Merge pull request #441 from jmbejar/ar_integration_test_harcoded_class_fix
...
Change hardcoded class in favor of using provided serializer class in AR integration tests
2013-11-03 12:34:15 -08:00
Jorge Bejar
021efae95b
Change hardcoded class in favor of using provided serializer class in AR integration tests
2013-11-03 18:21:21 -02:00
Rafael Mendonça França
402fa1134b
Merge pull request #440 from strzalek/jruby-tests
...
Make tests pass on jruby
2013-11-02 21:59:34 -07:00
Lukasz Strzalkowski
49d076507e
Make tests pass on jruby
2013-11-02 21:49:59 -07:00
Santiago Pastorino
ef1ec65ae7
Make DefaultSerializer include AM::Serializable so embedded_in_root_associations is always defined also there
2013-11-01 22:35:56 -02:00
Santiago Pastorino
882dbafa7e
embedded_in_root_associations is always defined
2013-11-01 21:37:49 -02:00
Arthur Neves
c001e964fe
Add note about master on README
2013-11-01 14:41:04 -04:00
Santiago Pastorino
66f9256534
Embed objects should return singular and not wrap in array
...
Closes #437
2013-11-01 14:22:52 -02:00
Santiago Pastorino
78cceb4113
Merge branch 'association_in_root_array_serializer'
2013-10-31 17:29:11 -02:00
Santiago Pastorino
d3d6c98148
Make ArraySerializer reuse Serializer embedded_in_root_associations code
2013-10-31 17:28:39 -02:00
Santiago Pastorino
5598bb0f79
Make Associations in root work with ArraySerializer
...
Closes #414
2013-10-31 17:27:36 -02:00
Santiago Pastorino
5a92e00b51
Merge branch 'has_one_arrays_pluralized'
2013-10-31 16:47:31 -02:00
Santiago Pastorino
85a9c185ca
Move responsibility of setting a serializer class and building a serializer for an association to the association class
2013-10-31 16:45:00 -02:00
Santiago Pastorino
616938dc63
Improve build_json_serializer readability a bit
2013-10-30 23:37:36 -02:00
Santiago Pastorino
4d4b820cbe
has_one returns arrays with roots pluralized
2013-10-30 15:26:13 -02:00
Santiago Pastorino
1eea008336
Split root construction and serialization logic
2013-10-29 19:39:27 -02:00
Santiago Pastorino
49ab359a34
Support passing a custom ArraySerializer for has_many associations
...
Thanks @phoet
Closes #316
2013-10-29 00:26:45 -02:00
Santiago Pastorino
ebe3afe716
Merge pull request #426 from mhenrixon/patch-1
...
Fix root initializer documentation
2013-10-26 13:56:56 -07:00
Mikael Henriksson
dcc4f27f63
Fix root initializer documentation
...
Removed the on load stuff since there is no autoloading in AMS anymore.
2013-10-26 22:13:34 +02:00
Santiago Pastorino
74d19e7d76
Merge pull request #424 from cball/update-association-key-in-readme
...
Update README to reflect override of json key in associations
2013-10-26 07:22:59 -07:00
Chris Ball
3b9b4d728a
Update README to reflect override of json key in associations
2013-10-26 10:08:20 -04:00
Santiago Pastorino
d5308b4d0b
Remove old unneeded code
2013-10-26 03:01:17 -02:00
Santiago Pastorino
1eb09476ef
Revert "Merge pull request #422 from marclove/reduce-serializer-code-complexity"
...
This reverts commit 449849516b , reversing
changes made to e103569c22 .
Conflicts:
lib/active_model/serializer.rb
2013-10-26 01:19:15 -02:00
Arthur Neves
303ac21428
Small refactoring
2013-10-25 19:58:06 -04:00
Arthur Nogueira Neves
449849516b
Merge pull request #422 from marclove/reduce-serializer-code-complexity
...
Reduce duplication; make accessor definition more explicit
2013-10-25 16:55:01 -07:00
Santiago Pastorino
e103569c22
Merge pull request #419 from whatsthebeef/master
...
Added note that objects will not be side-loaded if root is set to false
2013-10-25 16:16:12 -07:00
Marc Love
5ac6e626b5
Reduce complexity and duplication; make accessor definition more explicit
2013-10-25 15:33:24 -07:00
John Bower
3df8667708
Added note that objects will not be side-loaded if root is set to false
2013-10-25 16:32:23 -05:00
Arthur Nogueira Neves
74374ae5af
Merge pull request #418 from teeparham/patch-3
...
readme: move "Design and Implementation Guidelines" to the bottom
2013-10-25 09:15:49 -07:00
Tee Parham
6ed4598953
readme: move "Design and Implementation Guidelines" to the bottom
...
* rename "Design and Implementation" section to "Design and Implementation Guidelines"
2013-10-25 10:07:35 -06:00
Arthur Nogueira Neves
c4902f778c
Merge pull request #417 from teeparham/patch-2
...
update Readme
2013-10-25 08:57:01 -07:00
Tee Parham
fa3213e231
readme: clarify purpose
2013-10-25 09:36:27 -06:00
Tee Parham
b65715d5f8
split readme badges onto different lines
2013-10-25 09:26:28 -06:00
Santiago Pastorino
439643ba5a
Fix the stupid previous commit
2013-10-24 19:23:50 -02:00
Santiago Pastorino
b44e1af5dd
Move synchronize to setup method and make CONFIG private
2013-10-24 17:42:20 -02:00