Commit Graph

329 Commits

Author SHA1 Message Date
João Moura
954e4c51fe Merge pull request #1003 from Rodrigora/fix-transient-test-failures
Fix transient test failures
2015-07-14 01:35:45 -04:00
Rodrigo Ra
851d121ea8 fix transient test failures 2015-07-13 22:44:04 -03:00
João Moura
775737619a Merge pull request #996 from bf4/serializer_lint
Add linter for serializable resource
2015-07-13 19:37:39 -04:00
Benjamin Fleischer
28174e297d Add linter for serializable resource 2015-07-09 11:20:19 -05:00
João Moura
0201f2dd2a Merge pull request #990 from joaomdmoura/adding-json-api-meta-test
Adding json-api meta test
2015-07-08 10:39:36 -03:00
João Moura
7fb94234a8 adding json-api meta test help 2015-07-08 10:15:14 -03:00
João Moura
90fb1cf809 Merge pull request #984 from Rodrigora/add-key-option-to-associations
Add option "key" to serializer associations
2015-07-06 10:43:45 -03:00
Rodrigo Ra
df63b59512 Add key option to serializer associations 2015-07-05 19:47:58 -03:00
João Moura
ac1991fd6b Merge pull request #982 from bf4/typo
Fix typo
2015-07-02 19:06:32 -03:00
João Moura
6a122dacac Merge pull request #981 from bf4/remove_to_param
Remove unused PORO#to_param
2015-07-02 18:54:51 -03:00
Benjamin Fleischer
58a237ead1 Fix typo 2015-07-02 16:35:27 -05:00
Benjamin Fleischer
1bf2825909 Remove unused PORO#to_param 2015-07-02 16:34:10 -05:00
João Moura
952d8adcdc Merge pull request #978 from regonn/fix-generators-template
fix generators template bug
2015-07-02 00:31:55 -03:00
João Moura
a895de76bf Merge pull request #975 from GriffinHeart/fix-virtual-values
Fixes virtual value not being used
2015-07-01 23:04:54 -03:00
regonn
59a177e8b5 add serializer template test 2015-07-01 13:42:16 +09:00
regonn
5f300a0d42 fix generators template bug 2015-06-30 18:16:27 +09:00
Hugo Almeida
f25071ca70 Fixes virtual value not being used 2015-06-29 10:48:12 +09:00
João Moura
059409b0b9 Merge pull request #970 from Rodrigora/fix-test-race-conditions
Fix transient tests failures
2015-06-26 15:13:04 -03:00
Rodrigo Ra
7412c8d1c8 Fix transient tests failures 2015-06-26 09:33:53 -03:00
João Moura
03ac94b9b4 Merge pull request #962 from joaomdmoura/render-array-objects
Rendering objects that doesn't have serializers
2015-06-26 02:32:04 -03:00
Benjamin Fleischer
17d560eae4 Account for different handling of symbol keys in Rails 4.0
Comparing as a JSON string vs. as the Hash that is convert to JSON
works around the different Hash representations.

This likely has to do with the introduction of
config.action_dispatch.perform_deep_munge in Rails 4.1
See Rails issue 13420

  1) Failure:
  ActiveModel::Serializer::Adapter::Json::HasManyTestTest#test_has_many_with_no_serializer
  [active_model_serializers/test/adapter/json/has_many_test.rb:36]:
  --- expected
  +++ actual
  @@ -1 +1 @@
  -{:id=>42, :tags=>[{"attributes"=>{"id"=>1, "name"=>"#hash_tag"}}]}
  +{:id=>42, :tags=>[{"attributes"=>{:id=>1, :name=>"#hash_tag"}}]}

  2) Failure:
  ActiveModel::Serializer::AssociationsTest#test_has_many_with_no_serializer
  [active_model_serializers/test/serializers/associations_test.rb:74]:
  --- expected
  +++ actual
  @@ -1 +1 @@
  -[{"attributes"=>{"name"=>"#hashtagged"}}]
  +[{"attributes"=>{:name=>"#hashtagged"}}]
2015-06-26 02:16:35 -03:00
João Moura
741c4a4b51 updating tests to work with new virtual_value implementation 2015-06-26 02:16:35 -03:00
João Moura
d3649d5b4e Renaming Error to NoSerializerError 2015-06-26 02:16:35 -03:00
Benjamin Fleischer
e5d1e40dbd Handle special-case of Array serializer with unserializable elements 2015-06-26 02:16:34 -03:00
Benjamin Fleischer
cf77786da2 Fix #955 2015-06-26 02:16:34 -03:00
Justin Aiken
3710c32cee Add some failing tests around has_many assocs...
..where no serializer is defined for the thing that is has_many'd
2015-06-26 02:16:34 -03:00
João Moura
189b79523c fixing array rendering when elements doesn't have a serializer 2015-06-26 02:15:42 -03:00
João Moura
d589268f95 adding new tests to cover array and object rendering 2015-06-26 02:15:42 -03:00
João Moura
01a225f0e4 Merge pull request #939 from aaronlerch/default-cache-key
Use a more precise generated cache key
2015-06-26 02:09:28 -03:00
Aaron Lerch
6892ca39c9 Default the generated cache key to use custom #strftime instead of raw #to_s to achieve more accurate precision 2015-06-25 23:40:18 -04:00
João Moura
c0a82648d5 Merge pull request #971 from bf4/readd_has_one_to_generator
Restore has_one to generator
2015-06-25 18:37:52 -03:00
João Moura
1bb1724b5d Merge pull request #965 from bf4/serialization_options_default_nil
options fedault valueserializable_hash and as_json
2015-06-25 18:32:52 -03:00
Benjamin Fleischer
81935c8114 Restore has_one to generator
per #822 since it was readded in #725
2015-06-25 14:00:27 -05:00
Benjamin Fleischer
2d24dded14 serializable_hash and as_json should take options = nil
per ActiveModel::Serialization#serializable_hash
96bb004fc6/activemodel/lib/active_model/serialization.rb
    def serializable_hash(options = nil)
          options ||= {}

Otherwise, passing in nil to `as_json` or `serializable_hash`
makes things blow up when passing nil into attributes
2015-06-24 11:46:29 -05:00
João Moura
f67fd976ec Removing/Updating tests based on new FlattenJson adapter 2015-06-18 19:18:11 -03:00
João Moura
867d36a3a3 updating readme and changelog 2015-06-18 19:17:44 -03:00
João Moura
61ac3ad0ff Merge pull request #959 from kangkyu/patch-1
TYPO on README.md
2015-06-17 15:31:29 -03:00
Kang-Kyu Lee
ed818d9fd3 Update README.md
I wonder how `ActiveRecord::Serializer` and `ActiveRecord::Serializers` are different? However I found they have different name between the title and code.
2015-06-17 11:24:48 -07:00
João Moura
bc8fd0a44a Merge pull request #958 from joaomdmoura/spliting-json-adapter
Splitting json adapter into two
2015-06-16 11:54:33 -03:00
João Moura
e321cb366d Getting root key from AR::Relation 2015-06-16 11:36:17 -03:00
João Moura
65e0d79195 pluralising root key when using arraySerializer 2015-06-15 15:59:01 -03:00
João Moura
329691276a disabling custom root option 2015-06-15 15:58:39 -03:00
João Moura
d061b2e9f4 enabling flatten json as default adapter 2015-06-15 13:49:24 -03:00
João Moura
1ea5608e78 updating tests to match new adapters structure 2015-06-15 13:39:36 -03:00
João Moura
2e46507971 avoiding nil cases when dynamically creating a class 2015-06-15 02:50:06 -03:00
João Moura
8e1214b4c5 force to use flattenJson when dealing with ArraySerializer 2015-06-15 02:48:39 -03:00
João Moura
b2f1947d4a removing unseless root method 2015-06-14 17:24:48 -03:00
João Moura
2bf91a0c0e updating adapters to follow new root logic 2015-06-14 03:25:20 -03:00
João Moura
a0753cb0bc autoloading new flatten son adapter 2015-06-14 03:25:00 -03:00
João Moura
1c3a180a20 disable root as flag option 2015-06-13 15:48:33 -03:00