ember_serialize 0.0.7 → 0.0.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fe65116b35b11cf828d42b4e68953a1549e03349
4
- data.tar.gz: b17acc8e1c945e66c115228a8ab19426e9fc58e9
3
+ metadata.gz: 69ccc3471a52b442d9fb38daaa0e8de01078b949
4
+ data.tar.gz: 946427a20cab44780be6173e1f1b4a553a29c568
5
5
  SHA512:
6
- metadata.gz: b8d96496269e8453ed8b3d7f5d2fdfc20243b3942b9bcd16eb5f77c30defc8f86a9ddbde4d07b6e5adbade611a17551f8e88423c2f86675f8771b04fedd5d593
7
- data.tar.gz: 9dbb89fc26704727a85c285434037364124396464b5e9094bb1184d3bc38b7d888278f181965b8c10a05c0b0afa3259fa3be7358a8baa9cb7236511473bc58e8
6
+ metadata.gz: 7fb5de05a21f861b8012dca478ac6cf8abc5d4b74ceed51fb752934bc4e63ed9be32d531130933c4212b5176d30635a49ec1f30e279aa18b2112376b55c406a3
7
+ data.tar.gz: 1be336db47ea845e084a4f5fc964a1b7181f94252a811bdc96b5cdbc7c7c51f771ce6300ded4c9fa04f8ce6b1fa80ff7c8dd6683457c6e5ea6cbd267287a473f
@@ -127,7 +127,8 @@ MODEL
127
127
  if existing[camel_name].to_s =~ /hasMany/
128
128
  existing[camel_name]
129
129
  else
130
- "#{indent}#{camel_name}: DS.hasMany('#{camel_name}'#{_async})"
130
+ assoc_name = assoc.table_name.singularize
131
+ "#{indent}#{camel_name}: DS.hasMany('#{assoc_name}'#{_async})"
131
132
  end
132
133
  end
133
134
  else
@@ -1,3 +1,3 @@
1
1
  module EmberSerialize
2
- VERSION = "0.0.7"
2
+ VERSION = "0.0.8"
3
3
  end
@@ -4,5 +4,5 @@ EmberSerialize.Post = DS.Model.extend
4
4
  # ember_serialize:start
5
5
  title: DS.attr('string'),
6
6
  body: DS.attr('text'),
7
- comments: DS.hasMany('comments')
7
+ comments: DS.hasMany('comment')
8
8
  # ember_serialize:end
@@ -6,5 +6,5 @@ EmberSerialize.Post = DS.Model.extend
6
6
  body: DS.attr('string'),
7
7
  createdAt: DS.attr('date'),
8
8
  authorDude: DS.belongsTo('user', {async: true}),
9
- comments: DS.hasMany('comments', {async: true})
9
+ comments: DS.hasMany('comment', {async: true})
10
10
  # ember_serialize:end
@@ -4,5 +4,5 @@ EmberSerialize.Post = DS.Model.extend
4
4
  # ember_serialize:start
5
5
  title: DS.attr('string'),
6
6
  body: DS.attr('text'),
7
- comments: DS.hasMany('comments')
7
+ comments: DS.hasMany('comment')
8
8
  # ember_serialize:end
@@ -5,5 +5,5 @@ EmberSerialize.Post = DS.Model.extend
5
5
  # ember_serialize:async false
6
6
  title: DS.attr('string'),
7
7
  body: DS.attr('text'),
8
- comments: DS.hasMany('comments')
8
+ comments: DS.hasMany('comment')
9
9
  # ember_serialize:end
@@ -6,5 +6,5 @@ EmberSerialize.Post = DS.Model.extend
6
6
  title: DS.attr('string'),
7
7
  body: DS.attr('text'),
8
8
  authorDude: DS.belongsTo('user',{inverse:'find_existing'}),
9
- comments: DS.hasMany('comments')
9
+ comments: DS.hasMany('comment')
10
10
  # ember_serialize:end
@@ -4,6 +4,6 @@ EmberSerialize.Post = DS.Model.extend
4
4
  # ember_serialize:start
5
5
  # ember_serialize:ignore body
6
6
  title: DS.attr('string'),
7
- comments: DS.hasMany('comments')
7
+ comments: DS.hasMany('comment')
8
8
  authorDude: DS.belongsTo('user'),
9
9
  # ember_serialize:end
@@ -3,6 +3,6 @@
3
3
  EmberSerialize.Post = DS.Model.extend
4
4
  # ember_serialize:start
5
5
  title: DS.attr('string'),
6
- comments: DS.hasMany('comments')
6
+ comments: DS.hasMany('comment')
7
7
  authorDude: DS.belongsTo('user'),
8
8
  # ember_serialize:end
@@ -5,6 +5,6 @@ EmberSerialize.Post = DS.Model.extend
5
5
  # ember_serialize:async false
6
6
  title: DS.attr('string'),
7
7
  body: DS.attr('text'),
8
- comments: DS.hasMany('comments')
8
+ comments: DS.hasMany('comment')
9
9
  # ember_serialize:end
10
10
  authorDude: DS.belongsTo('user',{inverse: 'ignore_outside'}),
@@ -17661,5 +17661,398 @@ EmberSerializeTest: test_setting_ignore
17661
17661
   (0.1ms) begin transaction
17662
17662
  ------------------------------------------------
17663
17663
  EmberSerializeTest: test_skips_or_creates_models
17664
+ ------------------------------------------------
17665
+  (0.1ms) rollback transaction
17666
+ ActiveRecord::SchemaMigration Load (0.6ms) SELECT "schema_migrations".* FROM "schema_migrations"
17667
+  (0.1ms) begin transaction
17668
+ -----------------------------------------------
17669
+ EmberSerializeTest: test_accepts_async_argument
17670
+ -----------------------------------------------
17671
+  (0.1ms) rollback transaction
17672
+  (0.1ms) begin transaction
17673
+ ------------------------------------------------
17674
+ EmberSerializeTest: test_accepts_engine_argument
17675
+ ------------------------------------------------
17676
+  (0.1ms) rollback transaction
17677
+  (0.1ms) begin transaction
17678
+ ---------------------------------
17679
+ EmberSerializeTest: test_app_name
17680
+ ---------------------------------
17681
+  (0.1ms) rollback transaction
17682
+  (0.1ms) begin transaction
17683
+ -------------------------------------
17684
+ EmberSerializeTest: test_builds_model
17685
+ -------------------------------------
17686
+  (0.2ms) rollback transaction
17687
+  (0.1ms) begin transaction
17688
+ --------------------------------------
17689
+ EmberSerializeTest: test_camelize_name
17690
+ --------------------------------------
17691
+  (0.1ms) rollback transaction
17692
+  (0.1ms) begin transaction
17693
+ --------------------------------------------------------------------------
17694
+ EmberSerializeTest: test_does_not_throw_NameError_on_ApplicationSerializer
17695
+ --------------------------------------------------------------------------
17696
+  (0.1ms) rollback transaction
17697
+  (0.1ms) begin transaction
17698
+ ------------------------------------
17699
+ EmberSerializeTest: test_ember_model
17700
+ ------------------------------------
17701
+  (0.1ms) rollback transaction
17702
+  (0.0ms) begin transaction
17703
+ ------------------------------------------------
17704
+ EmberSerializeTest: test_ember_reflect_attribute
17705
+ ------------------------------------------------
17706
+  (0.1ms) rollback transaction
17707
+  (0.0ms) begin transaction
17708
+ -------------------------------------------------
17709
+ EmberSerializeTest: test_ember_reflect_belongs_to
17710
+ -------------------------------------------------
17711
+  (0.1ms) rollback transaction
17712
+  (0.1ms) begin transaction
17713
+ -----------------------------------------------
17714
+ EmberSerializeTest: test_ember_reflect_has_many
17715
+ -----------------------------------------------
17716
+  (0.2ms) rollback transaction
17717
+  (0.1ms) begin transaction
17718
+ ----------------------------------
17719
+ EmberSerializeTest: test_existence
17720
+ ----------------------------------
17721
+  (0.1ms) rollback transaction
17722
+  (0.0ms) begin transaction
17723
+ ----------------------------------
17724
+ EmberSerializeTest: test_ignore_id
17725
+ ----------------------------------
17726
+  (0.1ms) rollback transaction
17727
+  (0.1ms) begin transaction
17728
+ -----------------------------------
17729
+ EmberSerializeTest: test_initialize
17730
+ -----------------------------------
17731
+  (0.0ms) rollback transaction
17732
+  (0.0ms) begin transaction
17733
+ ----------------------------------------------
17734
+ EmberSerializeTest: test_makes_model_directory
17735
+ ----------------------------------------------
17736
+  (0.0ms) rollback transaction
17737
+  (0.1ms) begin transaction
17738
+ ----------------------------------------------
17739
+ EmberSerializeTest: test_parses_async_argument
17740
+ ----------------------------------------------
17741
+  (0.1ms) rollback transaction
17742
+  (0.1ms) begin transaction
17743
+ -------------------------------------
17744
+ EmberSerializeTest: test_parses_model
17745
+ -------------------------------------
17746
+  (0.2ms) rollback transaction
17747
+  (0.1ms) begin transaction
17748
+ ------------------------------------------------
17749
+ EmberSerializeTest: test_serialize_as_is_setting
17750
+ ------------------------------------------------
17751
+  (0.1ms) rollback transaction
17752
+  (0.1ms) begin transaction
17753
+ -----------------------------------------------------
17754
+ EmberSerializeTest: test_serialize_finds_associations
17755
+ -----------------------------------------------------
17756
+  (0.1ms) rollback transaction
17757
+  (0.0ms) begin transaction
17758
+ -------------------------------------------------
17759
+ EmberSerializeTest: test_serialize_finds_existing
17760
+ -------------------------------------------------
17761
+  (0.1ms) rollback transaction
17762
+  (0.1ms) begin transaction
17763
+ -------------------------------------------------
17764
+ EmberSerializeTest: test_serialize_ignore_setting
17765
+ -------------------------------------------------
17766
+  (0.1ms) rollback transaction
17767
+  (0.1ms) begin transaction
17768
+ --------------------------------------------------
17769
+ EmberSerializeTest: test_serialize_ignores_outside
17770
+ --------------------------------------------------
17771
+  (0.1ms) rollback transaction
17772
+  (0.1ms) begin transaction
17773
+ ---------------------------------------------------
17774
+ EmberSerializeTest: test_serializes_match_parameter
17775
+ ---------------------------------------------------
17776
+  (0.1ms) rollback transaction
17777
+  (0.0ms) begin transaction
17778
+ --------------------------------------
17779
+ EmberSerializeTest: test_setting_as_is
17780
+ --------------------------------------
17781
+  (0.1ms) rollback transaction
17782
+  (0.0ms) begin transaction
17783
+ --------------------------------------
17784
+ EmberSerializeTest: test_setting_async
17785
+ --------------------------------------
17786
+  (0.1ms) rollback transaction
17787
+  (0.0ms) begin transaction
17788
+ ---------------------------------------
17789
+ EmberSerializeTest: test_setting_ignore
17790
+ ---------------------------------------
17791
+  (0.0ms) rollback transaction
17792
+  (0.0ms) begin transaction
17793
+ ------------------------------------------------
17794
+ EmberSerializeTest: test_skips_or_creates_models
17795
+ ------------------------------------------------
17796
+  (0.1ms) rollback transaction
17797
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
17798
+  (0.1ms) begin transaction
17799
+ -----------------------------------------------
17800
+ EmberSerializeTest: test_accepts_async_argument
17801
+ -----------------------------------------------
17802
+  (0.1ms) rollback transaction
17803
+  (0.1ms) begin transaction
17804
+ ------------------------------------------------
17805
+ EmberSerializeTest: test_accepts_engine_argument
17806
+ ------------------------------------------------
17807
+  (0.1ms) rollback transaction
17808
+  (0.1ms) begin transaction
17809
+ ---------------------------------
17810
+ EmberSerializeTest: test_app_name
17811
+ ---------------------------------
17812
+  (0.1ms) rollback transaction
17813
+  (0.1ms) begin transaction
17814
+ -------------------------------------
17815
+ EmberSerializeTest: test_builds_model
17816
+ -------------------------------------
17817
+  (0.1ms) rollback transaction
17818
+  (0.1ms) begin transaction
17819
+ --------------------------------------
17820
+ EmberSerializeTest: test_camelize_name
17821
+ --------------------------------------
17822
+  (0.1ms) rollback transaction
17823
+  (0.1ms) begin transaction
17824
+ --------------------------------------------------------------------------
17825
+ EmberSerializeTest: test_does_not_throw_NameError_on_ApplicationSerializer
17826
+ --------------------------------------------------------------------------
17827
+  (0.1ms) rollback transaction
17828
+  (0.1ms) begin transaction
17829
+ ------------------------------------
17830
+ EmberSerializeTest: test_ember_model
17831
+ ------------------------------------
17832
+  (0.1ms) rollback transaction
17833
+  (0.1ms) begin transaction
17834
+ ------------------------------------------------
17835
+ EmberSerializeTest: test_ember_reflect_attribute
17836
+ ------------------------------------------------
17837
+  (0.0ms) rollback transaction
17838
+  (0.1ms) begin transaction
17839
+ -------------------------------------------------
17840
+ EmberSerializeTest: test_ember_reflect_belongs_to
17841
+ -------------------------------------------------
17842
+  (0.1ms) rollback transaction
17843
+  (0.1ms) begin transaction
17844
+ -----------------------------------------------
17845
+ EmberSerializeTest: test_ember_reflect_has_many
17846
+ -----------------------------------------------
17847
+  (0.1ms) rollback transaction
17848
+  (0.1ms) begin transaction
17849
+ ----------------------------------
17850
+ EmberSerializeTest: test_existence
17851
+ ----------------------------------
17852
+  (0.1ms) rollback transaction
17853
+  (0.1ms) begin transaction
17854
+ ----------------------------------
17855
+ EmberSerializeTest: test_ignore_id
17856
+ ----------------------------------
17857
+  (0.1ms) rollback transaction
17858
+  (0.1ms) begin transaction
17859
+ -----------------------------------
17860
+ EmberSerializeTest: test_initialize
17861
+ -----------------------------------
17862
+  (0.1ms) rollback transaction
17863
+  (0.0ms) begin transaction
17864
+ ----------------------------------------------
17865
+ EmberSerializeTest: test_makes_model_directory
17866
+ ----------------------------------------------
17867
+  (0.0ms) rollback transaction
17868
+  (0.1ms) begin transaction
17869
+ ----------------------------------------------
17870
+ EmberSerializeTest: test_parses_async_argument
17871
+ ----------------------------------------------
17872
+  (0.1ms) rollback transaction
17873
+  (0.1ms) begin transaction
17874
+ -------------------------------------
17875
+ EmberSerializeTest: test_parses_model
17876
+ -------------------------------------
17877
+  (0.2ms) rollback transaction
17878
+  (0.1ms) begin transaction
17879
+ ------------------------------------------------
17880
+ EmberSerializeTest: test_serialize_as_is_setting
17881
+ ------------------------------------------------
17882
+  (0.1ms) rollback transaction
17883
+  (0.1ms) begin transaction
17884
+ -----------------------------------------------------
17885
+ EmberSerializeTest: test_serialize_finds_associations
17886
+ -----------------------------------------------------
17887
+  (0.1ms) rollback transaction
17888
+  (0.1ms) begin transaction
17889
+ -------------------------------------------------
17890
+ EmberSerializeTest: test_serialize_finds_existing
17891
+ -------------------------------------------------
17892
+  (0.1ms) rollback transaction
17893
+  (0.0ms) begin transaction
17894
+ -------------------------------------------------
17895
+ EmberSerializeTest: test_serialize_ignore_setting
17896
+ -------------------------------------------------
17897
+  (0.1ms) rollback transaction
17898
+  (0.1ms) begin transaction
17899
+ --------------------------------------------------
17900
+ EmberSerializeTest: test_serialize_ignores_outside
17901
+ --------------------------------------------------
17902
+  (0.1ms) rollback transaction
17903
+  (0.0ms) begin transaction
17904
+ ---------------------------------------------------
17905
+ EmberSerializeTest: test_serializes_match_parameter
17906
+ ---------------------------------------------------
17907
+  (0.1ms) rollback transaction
17908
+  (0.1ms) begin transaction
17909
+ --------------------------------------
17910
+ EmberSerializeTest: test_setting_as_is
17911
+ --------------------------------------
17912
+  (0.0ms) rollback transaction
17913
+  (0.1ms) begin transaction
17914
+ --------------------------------------
17915
+ EmberSerializeTest: test_setting_async
17916
+ --------------------------------------
17917
+  (0.1ms) rollback transaction
17918
+  (0.1ms) begin transaction
17919
+ ---------------------------------------
17920
+ EmberSerializeTest: test_setting_ignore
17921
+ ---------------------------------------
17922
+  (0.1ms) rollback transaction
17923
+  (0.0ms) begin transaction
17924
+ ------------------------------------------------
17925
+ EmberSerializeTest: test_skips_or_creates_models
17926
+ ------------------------------------------------
17927
+  (0.1ms) rollback transaction
17928
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
17929
+  (0.1ms) begin transaction
17930
+ -----------------------------------------------
17931
+ EmberSerializeTest: test_accepts_async_argument
17932
+ -----------------------------------------------
17933
+  (0.1ms) rollback transaction
17934
+  (0.1ms) begin transaction
17935
+ ------------------------------------------------
17936
+ EmberSerializeTest: test_accepts_engine_argument
17937
+ ------------------------------------------------
17938
+  (0.1ms) rollback transaction
17939
+  (0.1ms) begin transaction
17940
+ ---------------------------------
17941
+ EmberSerializeTest: test_app_name
17942
+ ---------------------------------
17943
+  (0.1ms) rollback transaction
17944
+  (0.1ms) begin transaction
17945
+ -------------------------------------
17946
+ EmberSerializeTest: test_builds_model
17947
+ -------------------------------------
17948
+  (0.1ms) rollback transaction
17949
+  (0.1ms) begin transaction
17950
+ --------------------------------------
17951
+ EmberSerializeTest: test_camelize_name
17952
+ --------------------------------------
17953
+  (0.1ms) rollback transaction
17954
+  (0.0ms) begin transaction
17955
+ --------------------------------------------------------------------------
17956
+ EmberSerializeTest: test_does_not_throw_NameError_on_ApplicationSerializer
17957
+ --------------------------------------------------------------------------
17958
+  (0.1ms) rollback transaction
17959
+  (0.1ms) begin transaction
17960
+ ------------------------------------
17961
+ EmberSerializeTest: test_ember_model
17962
+ ------------------------------------
17963
+  (0.1ms) rollback transaction
17964
+  (0.1ms) begin transaction
17965
+ ------------------------------------------------
17966
+ EmberSerializeTest: test_ember_reflect_attribute
17967
+ ------------------------------------------------
17968
+  (0.1ms) rollback transaction
17969
+  (0.1ms) begin transaction
17970
+ -------------------------------------------------
17971
+ EmberSerializeTest: test_ember_reflect_belongs_to
17972
+ -------------------------------------------------
17973
+  (0.1ms) rollback transaction
17974
+  (0.1ms) begin transaction
17975
+ -----------------------------------------------
17976
+ EmberSerializeTest: test_ember_reflect_has_many
17977
+ -----------------------------------------------
17978
+  (0.1ms) rollback transaction
17979
+  (0.1ms) begin transaction
17980
+ ----------------------------------
17981
+ EmberSerializeTest: test_existence
17982
+ ----------------------------------
17983
+  (0.1ms) rollback transaction
17984
+  (0.0ms) begin transaction
17985
+ ----------------------------------
17986
+ EmberSerializeTest: test_ignore_id
17987
+ ----------------------------------
17988
+  (0.1ms) rollback transaction
17989
+  (0.1ms) begin transaction
17990
+ -----------------------------------
17991
+ EmberSerializeTest: test_initialize
17992
+ -----------------------------------
17993
+  (0.1ms) rollback transaction
17994
+  (0.0ms) begin transaction
17995
+ ----------------------------------------------
17996
+ EmberSerializeTest: test_makes_model_directory
17997
+ ----------------------------------------------
17998
+  (0.1ms) rollback transaction
17999
+  (0.0ms) begin transaction
18000
+ ----------------------------------------------
18001
+ EmberSerializeTest: test_parses_async_argument
18002
+ ----------------------------------------------
18003
+  (0.1ms) rollback transaction
18004
+  (0.1ms) begin transaction
18005
+ -------------------------------------
18006
+ EmberSerializeTest: test_parses_model
18007
+ -------------------------------------
18008
+  (0.1ms) rollback transaction
18009
+  (0.1ms) begin transaction
18010
+ ------------------------------------------------
18011
+ EmberSerializeTest: test_serialize_as_is_setting
18012
+ ------------------------------------------------
18013
+  (0.1ms) rollback transaction
18014
+  (0.0ms) begin transaction
18015
+ -----------------------------------------------------
18016
+ EmberSerializeTest: test_serialize_finds_associations
18017
+ -----------------------------------------------------
18018
+  (0.1ms) rollback transaction
18019
+  (0.0ms) begin transaction
18020
+ -------------------------------------------------
18021
+ EmberSerializeTest: test_serialize_finds_existing
18022
+ -------------------------------------------------
18023
+  (0.1ms) rollback transaction
18024
+  (0.0ms) begin transaction
18025
+ -------------------------------------------------
18026
+ EmberSerializeTest: test_serialize_ignore_setting
18027
+ -------------------------------------------------
18028
+  (0.1ms) rollback transaction
18029
+  (0.1ms) begin transaction
18030
+ --------------------------------------------------
18031
+ EmberSerializeTest: test_serialize_ignores_outside
18032
+ --------------------------------------------------
18033
+  (0.1ms) rollback transaction
18034
+  (0.1ms) begin transaction
18035
+ ---------------------------------------------------
18036
+ EmberSerializeTest: test_serializes_match_parameter
18037
+ ---------------------------------------------------
18038
+  (0.1ms) rollback transaction
18039
+  (0.0ms) begin transaction
18040
+ --------------------------------------
18041
+ EmberSerializeTest: test_setting_as_is
18042
+ --------------------------------------
18043
+  (0.1ms) rollback transaction
18044
+  (0.1ms) begin transaction
18045
+ --------------------------------------
18046
+ EmberSerializeTest: test_setting_async
18047
+ --------------------------------------
18048
+  (0.1ms) rollback transaction
18049
+  (0.1ms) begin transaction
18050
+ ---------------------------------------
18051
+ EmberSerializeTest: test_setting_ignore
18052
+ ---------------------------------------
18053
+  (0.1ms) rollback transaction
18054
+  (0.1ms) begin transaction
18055
+ ------------------------------------------------
18056
+ EmberSerializeTest: test_skips_or_creates_models
17664
18057
  ------------------------------------------------
17665
18058
   (0.1ms) rollback transaction
@@ -132,21 +132,21 @@ WITHOUTEM
132
132
  end
133
133
 
134
134
  test "ember_reflect has_many" do
135
- assert_equal ["posts", " posts: DS.hasMany('posts')"], @serializer.ember_reflect(User, :posts, :has_many, false, {}, ' '), 'has_many'
136
- assert_equal ["posts", " posts: DS.hasMany('posts', {async: true})"], @serializer.ember_reflect(User, :posts, :has_many, true, {}, ' '), 'has_many async true'
137
- assert_equal ["posts", " posts: DS.hasMany('posts', {inverse: 'lemoo'})"], @serializer.ember_reflect(User, :posts, :has_many, false, {'posts' => " posts: DS.hasMany('posts', {inverse: 'lemoo'})"}, ' '), 'has_many existing'
135
+ assert_equal ["posts", " posts: DS.hasMany('post')"], @serializer.ember_reflect(User, :posts, :has_many, false, {}, ' '), 'has_many'
136
+ assert_equal ["posts", " posts: DS.hasMany('post', {async: true})"], @serializer.ember_reflect(User, :posts, :has_many, true, {}, ' '), 'has_many async true'
137
+ assert_equal ["posts", " posts: DS.hasMany('post', {inverse: 'lemoo'})"], @serializer.ember_reflect(User, :posts, :has_many, false, {'posts' => " posts: DS.hasMany('post', {inverse: 'lemoo'})"}, ' '), 'has_many existing'
138
138
  end
139
139
 
140
140
  test "parses model" do
141
141
  revert_models
142
- match = [["# for more details see: http://emberjs.com/guides/models/defining-models/", "", "EmberSerialize.Post = DS.Model.extend", " # ember_serialize:start", " title: DS.attr('string'),", " body: DS.attr('text'),", " comments: DS.hasMany('comments')", " # ember_serialize:end"], 3, 7, {"title"=>" title: DS.attr('string')", "body"=>" body: DS.attr('text')", "comments"=>" comments: DS.hasMany('comments')"}, [], [], true, " "]
142
+ match = [["# for more details see: http://emberjs.com/guides/models/defining-models/", "", "EmberSerialize.Post = DS.Model.extend", " # ember_serialize:start", " title: DS.attr('string'),", " body: DS.attr('text'),", " comments: DS.hasMany('comment')", " # ember_serialize:end"], 3, 7, {"title"=>" title: DS.attr('string')", "body"=>" body: DS.attr('text')", "comments"=>" comments: DS.hasMany('comment')"}, [], [], true, " "]
143
143
  result = @serializer.ember_model_parse "#{@mdir}post.js.coffee", Post
144
144
  assert_equal match, result, 'ember_model_parse'
145
145
  end
146
146
 
147
147
  test "builds model" do
148
148
  ams = ActiveModel::Serializer.descendants.sort_by(&:name)[2]
149
- args = [["# for more details see: http://emberjs.com/guides/models/defining-models/", "", "EmberSerialize.Post = DS.Model.extend", " # ember_serialize:start", " # ember_serialize:async false", " id: DS.attr('integer'),", " title: DS.attr('string'),", " body: DS.attr('text'),", " authorDude: DS.belongsTo('user'),", " comments: DS.hasMany('comments')", " # ember_serialize:end"], 3, 10, {"id"=>" id: DS.attr('integer')", "title"=>" title: DS.attr('string')", "body"=>" body: DS.attr('text')", "authorDude"=>" authorDude: DS.belongsTo('user')", "comments"=>" comments: DS.hasMany('comments')"}, [], [], false, " "]
149
+ args = [["# for more details see: http://emberjs.com/guides/models/defining-models/", "", "EmberSerialize.Post = DS.Model.extend", " # ember_serialize:start", " # ember_serialize:async false", " id: DS.attr('integer'),", " title: DS.attr('string'),", " body: DS.attr('text'),", " authorDude: DS.belongsTo('user'),", " comments: DS.hasMany('comment')", " # ember_serialize:end"], 3, 10, {"id"=>" id: DS.attr('integer')", "title"=>" title: DS.attr('string')", "body"=>" body: DS.attr('text')", "authorDude"=>" authorDude: DS.belongsTo('user')", "comments"=>" comments: DS.hasMany('comment')"}, [], [], false, " "]
150
150
  match = "# for more details see: http://emberjs.com/guides/models/defining-models/
151
151
 
152
152
  EmberSerialize.Post = DS.Model.extend
@@ -156,7 +156,7 @@ EmberSerialize.Post = DS.Model.extend
156
156
  body: DS.attr('text'),
157
157
  createdAt: DS.attr('date'),
158
158
  authorDude: DS.belongsTo('user'),
159
- comments: DS.hasMany('comments')
159
+ comments: DS.hasMany('comment')
160
160
  # ember_serialize:end"
161
161
  result = @serializer.ember_model_build @serializer.schema(ams),
162
162
  Post, args
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ember_serialize
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Noel Peden
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-09-06 00:00:00.000000000 Z
11
+ date: 2014-09-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -102,13 +102,15 @@ executables: []
102
102
  extensions: []
103
103
  extra_rdoc_files: []
104
104
  files:
105
+ - MIT-LICENSE
106
+ - Rakefile
107
+ - lib/ember_serialize.rb
105
108
  - lib/ember_serialize/railtie.rb
106
109
  - lib/ember_serialize/version.rb
107
- - lib/ember_serialize.rb
108
110
  - lib/tasks/ember_serialize_tasks.rake
109
- - MIT-LICENSE
110
- - Rakefile
111
111
  - test/ci.sh
112
+ - test/dummy/README.rdoc
113
+ - test/dummy/Rakefile
112
114
  - test/dummy/app/assets/javascripts/application.js.coffee
113
115
  - test/dummy/app/assets/javascripts/models/comment.js.coffee
114
116
  - test/dummy/app/assets/javascripts/models/default/comment.js.coffee
@@ -138,6 +140,7 @@ files:
138
140
  - test/dummy/bin/bundle
139
141
  - test/dummy/bin/rails
140
142
  - test/dummy/bin/rake
143
+ - test/dummy/config.ru
141
144
  - test/dummy/config/application.rb
142
145
  - test/dummy/config/boot.rb
143
146
  - test/dummy/config/database.yml
@@ -156,7 +159,6 @@ files:
156
159
  - test/dummy/config/locales/en.yml
157
160
  - test/dummy/config/routes.rb
158
161
  - test/dummy/config/secrets.yml
159
- - test/dummy/config.ru
160
162
  - test/dummy/db/development.sqlite3
161
163
  - test/dummy/db/migrate/20140825151402_create_users.rb
162
164
  - test/dummy/db/migrate/20140825151509_create_posts.rb
@@ -170,8 +172,6 @@ files:
170
172
  - test/dummy/public/422.html
171
173
  - test/dummy/public/500.html
172
174
  - test/dummy/public/favicon.ico
173
- - test/dummy/Rakefile
174
- - test/dummy/README.rdoc
175
175
  - test/dummy/tmp/ember-rails/ember-data.js
176
176
  - test/dummy/tmp/ember-rails/ember.js
177
177
  - test/ember_serialize_test.rb
@@ -196,7 +196,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
196
196
  version: '0'
197
197
  requirements: []
198
198
  rubyforge_project:
199
- rubygems_version: 2.0.6
199
+ rubygems_version: 2.2.2
200
200
  signing_key:
201
201
  specification_version: 4
202
202
  summary: Generate ember models from Rails serializers