ember_serialize 0.0.5 → 0.0.6

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: a63e00e60fd0504935cc7d5d6295b3a063e09bf6
4
- data.tar.gz: 0df2489b9ca6599caa25074e2b7e754d211e9931
3
+ metadata.gz: bf12c7ec4b046d92d09b628e86d42d783e2bbfa6
4
+ data.tar.gz: 9477e892cbd774d1d1a170f75f76dc1f8d5af38a
5
5
  SHA512:
6
- metadata.gz: 7e79e24606521a5bf1348960d0fcff493a6c4d26916a0a82d69ebb2403b629ec1cf9f75afe39fc7d5cd43d0c010d662208fb18d2c59616ee5c364bbf039f22f9
7
- data.tar.gz: f4f5abeb10131ee42b2f1478db29a0f73d669b6be5b746d46cfb853e2f3287e20eb1bdb40326130f9b53bfbc7d4811b3a29dfede6abc553911283788100a90b7
6
+ metadata.gz: ab8840016ec88e337dd3b39e2ab45fe4ea8a91e3cc488a9d8de4400b8f09988721bff03016390d973d09ba70ebc9e0299fa8d96399aa46710f3fcc4baf01c899
7
+ data.tar.gz: 224521071a26d8e7500e58eb0c092c666d81026ee67a420c502e149e4b65fadb61b6af93ee82cf44885426105969d9a31debf91f1a13437c453589719f4c33d8
@@ -1,3 +1,3 @@
1
1
  module EmberSerialize
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
@@ -118,7 +118,7 @@ MODEL
118
118
  end
119
119
  end
120
120
  else
121
- existing[camel_name] || "#{indent}#{camel_name}: DS.attr('#{type}')"
121
+ existing[camel_name] || "#{indent}#{camel_name}: DS.attr('#{type || 'string'}')"
122
122
  end
123
123
  [camel_name, line]
124
124
  end
@@ -195,6 +195,7 @@ MODEL
195
195
  else
196
196
  ember_reflect(model, name, :attribute, async, existing, indent, type)
197
197
  end
198
+ next if camel_name == 'id'
198
199
  unless ignore.include? camel_name
199
200
  new_lines << line
200
201
  end
@@ -2,7 +2,6 @@
2
2
 
3
3
  EmberSerialize.Comment = DS.Model.extend
4
4
  # ember_serialize:start
5
- id: DS.attr('integer'),
6
5
  title: DS.attr('string'),
7
6
  body: DS.attr('text'),
8
7
  post: DS.belongsTo('post', {async: true}),
@@ -2,7 +2,6 @@
2
2
 
3
3
  EmberSerialize.Comment = DS.Model.extend
4
4
  # ember_serialize:start
5
- id: DS.attr('integer'),
6
5
  title: DS.attr('string'),
7
6
  body: DS.attr('text'),
8
7
  author: DS.belongsTo('user'),
@@ -2,7 +2,6 @@
2
2
 
3
3
  EmberSerialize.Post = DS.Model.extend
4
4
  # ember_serialize:start
5
- id: DS.attr('integer'),
6
5
  title: DS.attr('string'),
7
6
  body: DS.attr('text'),
8
7
  comments: DS.hasMany('comments')
@@ -2,6 +2,5 @@
2
2
 
3
3
  EmberSerialize.User = DS.Model.extend
4
4
  # ember_serialize:start
5
- id: DS.attr('integer'),
6
5
  name: DS.attr('string')
7
6
  # ember_serialize:end
@@ -2,7 +2,6 @@
2
2
 
3
3
  EmberSerialize.Post = DS.Model.extend
4
4
  # ember_serialize:start
5
- id: DS.attr('integer'),
6
5
  title: DS.attr('string'),
7
6
  body: DS.attr('text'),
8
7
  authorDude: DS.belongsTo('user', {async: true}),
@@ -3,9 +3,8 @@
3
3
  EmberSerialize.Comment = DS.Model.extend
4
4
  # ember_serialize:start
5
5
  # ember_serialize:as_is post_id
6
- id: DS.attr('integer'),
7
6
  title: DS.attr('string'),
8
7
  body: DS.attr('text'),
9
8
  author: DS.belongsTo('user'),
10
9
  post: DS.belongsTo('post')
11
- # ember_serialize:end
10
+ # ember_serialize:end
@@ -2,8 +2,7 @@
2
2
 
3
3
  EmberSerialize.Post = DS.Model.extend
4
4
  # ember_serialize:start
5
- id: DS.attr('integer'),
6
5
  title: DS.attr('string'),
7
6
  body: DS.attr('text'),
8
7
  comments: DS.hasMany('comments')
9
- # ember_serialize:end
8
+ # ember_serialize:end
@@ -3,8 +3,7 @@
3
3
  EmberSerialize.Post = DS.Model.extend
4
4
  # ember_serialize:start
5
5
  # ember_serialize:async false
6
- id: DS.attr('integer'),
7
6
  title: DS.attr('string'),
8
7
  body: DS.attr('text'),
9
8
  comments: DS.hasMany('comments')
10
- # ember_serialize:end
9
+ # ember_serialize:end
@@ -3,9 +3,8 @@
3
3
  EmberSerialize.Post = DS.Model.extend
4
4
  # ember_serialize:start
5
5
  # ember_serialize:async false
6
- id: DS.attr('integer'),
7
6
  title: DS.attr('string'),
8
7
  body: DS.attr('text'),
9
8
  authorDude: DS.belongsTo('user',{inverse:'find_existing'}),
10
9
  comments: DS.hasMany('comments')
11
- # ember_serialize:end
10
+ # ember_serialize:end
@@ -3,7 +3,6 @@
3
3
  EmberSerialize.Post = DS.Model.extend
4
4
  # ember_serialize:start
5
5
  # ember_serialize:ignore body
6
- id: DS.attr('integer'),
7
6
  title: DS.attr('string'),
8
7
  comments: DS.hasMany('comments')
9
8
  authorDude: DS.belongsTo('user'),
@@ -0,0 +1,8 @@
1
+ # for more details see: http://emberjs.com/guides/models/defining-models/
2
+
3
+ EmberSerialize.Post = DS.Model.extend
4
+ # ember_serialize:start
5
+ title: DS.attr('string'),
6
+ comments: DS.hasMany('comments')
7
+ authorDude: DS.belongsTo('user'),
8
+ # ember_serialize:end
@@ -3,7 +3,6 @@
3
3
  EmberSerialize.Post = DS.Model.extend
4
4
  # ember_serialize:start
5
5
  # ember_serialize:async false
6
- id: DS.attr('integer'),
7
6
  title: DS.attr('string'),
8
7
  body: DS.attr('text'),
9
8
  comments: DS.hasMany('comments')
@@ -2,6 +2,5 @@
2
2
 
3
3
  EmberSerialize.User = DS.Model.extend
4
4
  # ember_serialize:start
5
- id: DS.attr('integer'),
6
5
  name: DS.attr('string')
7
6
  # ember_serialize:end
@@ -12760,5 +12760,701 @@ EmberSerializeTest: test_serializes_match_parameter
12760
12760
   (0.1ms) begin transaction
12761
12761
  ------------------------------------------------
12762
12762
  EmberSerializeTest: test_skips_or_creates_models
12763
+ ------------------------------------------------
12764
+  (0.1ms) rollback transaction
12765
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
12766
+  (0.1ms) begin transaction
12767
+ -----------------------------------------------
12768
+ EmberSerializeTest: test_accepts_async_argument
12769
+ -----------------------------------------------
12770
+  (0.1ms) rollback transaction
12771
+  (0.1ms) begin transaction
12772
+ ------------------------------------------------
12773
+ EmberSerializeTest: test_accepts_engine_argument
12774
+ ------------------------------------------------
12775
+  (0.1ms) rollback transaction
12776
+  (0.0ms) begin transaction
12777
+ ---------------------------------
12778
+ EmberSerializeTest: test_app_name
12779
+ ---------------------------------
12780
+  (0.1ms) rollback transaction
12781
+  (0.0ms) begin transaction
12782
+ -------------------------------------
12783
+ EmberSerializeTest: test_builds_model
12784
+ -------------------------------------
12785
+  (0.1ms) rollback transaction
12786
+  (0.0ms) begin transaction
12787
+ --------------------------------------
12788
+ EmberSerializeTest: test_camelize_name
12789
+ --------------------------------------
12790
+  (0.0ms) rollback transaction
12791
+  (0.0ms) begin transaction
12792
+ --------------------------------------------------------------------------
12793
+ EmberSerializeTest: test_does_not_throw_NameError_on_ApplicationSerializer
12794
+ --------------------------------------------------------------------------
12795
+  (0.1ms) rollback transaction
12796
+  (0.1ms) begin transaction
12797
+ ------------------------------------
12798
+ EmberSerializeTest: test_ember_model
12799
+ ------------------------------------
12800
+  (0.1ms) rollback transaction
12801
+  (0.0ms) begin transaction
12802
+ ------------------------------------------------
12803
+ EmberSerializeTest: test_ember_reflect_attribute
12804
+ ------------------------------------------------
12805
+  (0.1ms) rollback transaction
12806
+  (0.1ms) begin transaction
12807
+ -------------------------------------------------
12808
+ EmberSerializeTest: test_ember_reflect_belongs_to
12809
+ -------------------------------------------------
12810
+  (0.1ms) rollback transaction
12811
+  (0.0ms) begin transaction
12812
+ -----------------------------------------------
12813
+ EmberSerializeTest: test_ember_reflect_has_many
12814
+ -----------------------------------------------
12815
+  (0.0ms) rollback transaction
12816
+  (0.0ms) begin transaction
12817
+ ----------------------------------
12818
+ EmberSerializeTest: test_existence
12819
+ ----------------------------------
12820
+  (0.0ms) rollback transaction
12821
+  (0.0ms) begin transaction
12822
+ ----------------------------------
12823
+ EmberSerializeTest: test_ignore_id
12824
+ ----------------------------------
12825
+  (0.1ms) rollback transaction
12826
+  (0.1ms) begin transaction
12827
+ -----------------------------------
12828
+ EmberSerializeTest: test_initialize
12829
+ -----------------------------------
12830
+  (0.1ms) rollback transaction
12831
+  (0.0ms) begin transaction
12832
+ ----------------------------------------------
12833
+ EmberSerializeTest: test_makes_model_directory
12834
+ ----------------------------------------------
12835
+  (0.1ms) rollback transaction
12836
+  (0.0ms) begin transaction
12837
+ ----------------------------------------------
12838
+ EmberSerializeTest: test_parses_async_argument
12839
+ ----------------------------------------------
12840
+  (0.1ms) rollback transaction
12841
+  (0.0ms) begin transaction
12842
+ -------------------------------------
12843
+ EmberSerializeTest: test_parses_model
12844
+ -------------------------------------
12845
+  (0.3ms) rollback transaction
12846
+  (0.1ms) begin transaction
12847
+ ------------------------------------------------
12848
+ EmberSerializeTest: test_serialize_as_is_setting
12849
+ ------------------------------------------------
12850
+  (0.1ms) rollback transaction
12851
+  (0.0ms) begin transaction
12852
+ -----------------------------------------------------
12853
+ EmberSerializeTest: test_serialize_finds_associations
12854
+ -----------------------------------------------------
12855
+  (0.1ms) rollback transaction
12856
+  (0.1ms) begin transaction
12857
+ -------------------------------------------------
12858
+ EmberSerializeTest: test_serialize_finds_existing
12859
+ -------------------------------------------------
12860
+  (0.1ms) rollback transaction
12861
+  (0.1ms) begin transaction
12862
+ -------------------------------------------------
12863
+ EmberSerializeTest: test_serialize_ignore_setting
12864
+ -------------------------------------------------
12865
+  (0.1ms) rollback transaction
12866
+  (0.1ms) begin transaction
12867
+ --------------------------------------------------
12868
+ EmberSerializeTest: test_serialize_ignores_outside
12869
+ --------------------------------------------------
12870
+  (0.1ms) rollback transaction
12871
+  (0.1ms) begin transaction
12872
+ ---------------------------------------------------
12873
+ EmberSerializeTest: test_serializes_match_parameter
12874
+ ---------------------------------------------------
12875
+  (0.1ms) rollback transaction
12876
+  (0.1ms) begin transaction
12877
+ ------------------------------------------------
12878
+ EmberSerializeTest: test_skips_or_creates_models
12879
+ ------------------------------------------------
12880
+  (0.1ms) rollback transaction
12881
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
12882
+  (0.1ms) begin transaction
12883
+ -----------------------------------------------
12884
+ EmberSerializeTest: test_accepts_async_argument
12885
+ -----------------------------------------------
12886
+  (0.1ms) rollback transaction
12887
+  (0.1ms) begin transaction
12888
+ ------------------------------------------------
12889
+ EmberSerializeTest: test_accepts_engine_argument
12890
+ ------------------------------------------------
12891
+  (0.1ms) rollback transaction
12892
+  (0.1ms) begin transaction
12893
+ ---------------------------------
12894
+ EmberSerializeTest: test_app_name
12895
+ ---------------------------------
12896
+  (0.1ms) rollback transaction
12897
+  (0.1ms) begin transaction
12898
+ -------------------------------------
12899
+ EmberSerializeTest: test_builds_model
12900
+ -------------------------------------
12901
+  (0.1ms) rollback transaction
12902
+  (0.1ms) begin transaction
12903
+ --------------------------------------
12904
+ EmberSerializeTest: test_camelize_name
12905
+ --------------------------------------
12906
+  (0.1ms) rollback transaction
12907
+  (0.1ms) begin transaction
12908
+ --------------------------------------------------------------------------
12909
+ EmberSerializeTest: test_does_not_throw_NameError_on_ApplicationSerializer
12910
+ --------------------------------------------------------------------------
12911
+  (0.1ms) rollback transaction
12912
+  (0.1ms) begin transaction
12913
+ ------------------------------------
12914
+ EmberSerializeTest: test_ember_model
12915
+ ------------------------------------
12916
+  (0.1ms) rollback transaction
12917
+  (0.0ms) begin transaction
12918
+ ------------------------------------------------
12919
+ EmberSerializeTest: test_ember_reflect_attribute
12920
+ ------------------------------------------------
12921
+  (0.2ms) rollback transaction
12922
+  (0.1ms) begin transaction
12923
+ -------------------------------------------------
12924
+ EmberSerializeTest: test_ember_reflect_belongs_to
12925
+ -------------------------------------------------
12926
+  (0.1ms) rollback transaction
12927
+  (0.1ms) begin transaction
12928
+ -----------------------------------------------
12929
+ EmberSerializeTest: test_ember_reflect_has_many
12930
+ -----------------------------------------------
12931
+  (0.1ms) rollback transaction
12932
+  (0.1ms) begin transaction
12933
+ ----------------------------------
12934
+ EmberSerializeTest: test_existence
12935
+ ----------------------------------
12936
+  (0.1ms) rollback transaction
12937
+  (0.1ms) begin transaction
12938
+ ----------------------------------
12939
+ EmberSerializeTest: test_ignore_id
12940
+ ----------------------------------
12941
+  (0.2ms) rollback transaction
12942
+  (0.3ms) begin transaction
12943
+ -----------------------------------
12944
+ EmberSerializeTest: test_initialize
12945
+ -----------------------------------
12946
+  (0.1ms) rollback transaction
12947
+  (0.1ms) begin transaction
12948
+ ----------------------------------------------
12949
+ EmberSerializeTest: test_makes_model_directory
12950
+ ----------------------------------------------
12951
+  (0.1ms) rollback transaction
12952
+  (0.1ms) begin transaction
12953
+ ----------------------------------------------
12954
+ EmberSerializeTest: test_parses_async_argument
12955
+ ----------------------------------------------
12956
+  (0.1ms) rollback transaction
12957
+  (0.0ms) begin transaction
12958
+ -------------------------------------
12959
+ EmberSerializeTest: test_parses_model
12960
+ -------------------------------------
12961
+  (0.2ms) rollback transaction
12962
+  (0.1ms) begin transaction
12963
+ ------------------------------------------------
12964
+ EmberSerializeTest: test_serialize_as_is_setting
12965
+ ------------------------------------------------
12966
+  (0.1ms) rollback transaction
12967
+  (0.1ms) begin transaction
12968
+ -----------------------------------------------------
12969
+ EmberSerializeTest: test_serialize_finds_associations
12970
+ -----------------------------------------------------
12971
+  (0.1ms) rollback transaction
12972
+  (0.0ms) begin transaction
12973
+ -------------------------------------------------
12974
+ EmberSerializeTest: test_serialize_finds_existing
12975
+ -------------------------------------------------
12976
+  (0.1ms) rollback transaction
12977
+  (0.1ms) begin transaction
12978
+ -------------------------------------------------
12979
+ EmberSerializeTest: test_serialize_ignore_setting
12980
+ -------------------------------------------------
12981
+  (0.1ms) rollback transaction
12982
+  (0.1ms) begin transaction
12983
+ --------------------------------------------------
12984
+ EmberSerializeTest: test_serialize_ignores_outside
12985
+ --------------------------------------------------
12986
+  (0.1ms) rollback transaction
12987
+  (0.1ms) begin transaction
12988
+ ---------------------------------------------------
12989
+ EmberSerializeTest: test_serializes_match_parameter
12990
+ ---------------------------------------------------
12991
+  (0.1ms) rollback transaction
12992
+  (0.1ms) begin transaction
12993
+ ------------------------------------------------
12994
+ EmberSerializeTest: test_skips_or_creates_models
12995
+ ------------------------------------------------
12996
+  (0.1ms) rollback transaction
12997
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
12998
+  (0.1ms) begin transaction
12999
+ -----------------------------------------------
13000
+ EmberSerializeTest: test_accepts_async_argument
13001
+ -----------------------------------------------
13002
+  (0.1ms) rollback transaction
13003
+  (0.0ms) begin transaction
13004
+ ------------------------------------------------
13005
+ EmberSerializeTest: test_accepts_engine_argument
13006
+ ------------------------------------------------
13007
+  (0.1ms) rollback transaction
13008
+  (0.0ms) begin transaction
13009
+ ---------------------------------
13010
+ EmberSerializeTest: test_app_name
13011
+ ---------------------------------
13012
+  (0.0ms) rollback transaction
13013
+  (0.0ms) begin transaction
13014
+ -------------------------------------
13015
+ EmberSerializeTest: test_builds_model
13016
+ -------------------------------------
13017
+  (0.1ms) rollback transaction
13018
+  (0.0ms) begin transaction
13019
+ --------------------------------------
13020
+ EmberSerializeTest: test_camelize_name
13021
+ --------------------------------------
13022
+  (0.1ms) rollback transaction
13023
+  (0.1ms) begin transaction
13024
+ --------------------------------------------------------------------------
13025
+ EmberSerializeTest: test_does_not_throw_NameError_on_ApplicationSerializer
13026
+ --------------------------------------------------------------------------
13027
+  (0.1ms) rollback transaction
13028
+  (0.1ms) begin transaction
13029
+ ------------------------------------
13030
+ EmberSerializeTest: test_ember_model
13031
+ ------------------------------------
13032
+  (0.1ms) rollback transaction
13033
+  (0.0ms) begin transaction
13034
+ ------------------------------------------------
13035
+ EmberSerializeTest: test_ember_reflect_attribute
13036
+ ------------------------------------------------
13037
+  (0.1ms) rollback transaction
13038
+  (0.0ms) begin transaction
13039
+ -------------------------------------------------
13040
+ EmberSerializeTest: test_ember_reflect_belongs_to
13041
+ -------------------------------------------------
13042
+  (0.1ms) rollback transaction
13043
+  (0.1ms) begin transaction
13044
+ -----------------------------------------------
13045
+ EmberSerializeTest: test_ember_reflect_has_many
13046
+ -----------------------------------------------
13047
+  (0.1ms) rollback transaction
13048
+  (0.1ms) begin transaction
13049
+ ----------------------------------
13050
+ EmberSerializeTest: test_existence
13051
+ ----------------------------------
13052
+  (0.0ms) rollback transaction
13053
+  (0.0ms) begin transaction
13054
+ ----------------------------------
13055
+ EmberSerializeTest: test_ignore_id
13056
+ ----------------------------------
13057
+  (0.2ms) rollback transaction
13058
+  (0.1ms) begin transaction
13059
+ -----------------------------------
13060
+ EmberSerializeTest: test_initialize
13061
+ -----------------------------------
13062
+  (0.1ms) rollback transaction
13063
+  (0.1ms) begin transaction
13064
+ ----------------------------------------------
13065
+ EmberSerializeTest: test_makes_model_directory
13066
+ ----------------------------------------------
13067
+  (0.1ms) rollback transaction
13068
+  (0.1ms) begin transaction
13069
+ ----------------------------------------------
13070
+ EmberSerializeTest: test_parses_async_argument
13071
+ ----------------------------------------------
13072
+  (0.1ms) rollback transaction
13073
+  (0.0ms) begin transaction
13074
+ -------------------------------------
13075
+ EmberSerializeTest: test_parses_model
13076
+ -------------------------------------
13077
+  (0.2ms) rollback transaction
13078
+  (0.1ms) begin transaction
13079
+ ------------------------------------------------
13080
+ EmberSerializeTest: test_serialize_as_is_setting
13081
+ ------------------------------------------------
13082
+  (0.1ms) rollback transaction
13083
+  (0.1ms) begin transaction
13084
+ -----------------------------------------------------
13085
+ EmberSerializeTest: test_serialize_finds_associations
13086
+ -----------------------------------------------------
13087
+  (0.1ms) rollback transaction
13088
+  (0.0ms) begin transaction
13089
+ -------------------------------------------------
13090
+ EmberSerializeTest: test_serialize_finds_existing
13091
+ -------------------------------------------------
13092
+  (0.1ms) rollback transaction
13093
+  (0.1ms) begin transaction
13094
+ -------------------------------------------------
13095
+ EmberSerializeTest: test_serialize_ignore_setting
13096
+ -------------------------------------------------
13097
+  (0.1ms) rollback transaction
13098
+  (0.1ms) begin transaction
13099
+ --------------------------------------------------
13100
+ EmberSerializeTest: test_serialize_ignores_outside
13101
+ --------------------------------------------------
13102
+  (0.1ms) rollback transaction
13103
+  (0.1ms) begin transaction
13104
+ ---------------------------------------------------
13105
+ EmberSerializeTest: test_serializes_match_parameter
13106
+ ---------------------------------------------------
13107
+  (0.1ms) rollback transaction
13108
+  (0.1ms) begin transaction
13109
+ ------------------------------------------------
13110
+ EmberSerializeTest: test_skips_or_creates_models
13111
+ ------------------------------------------------
13112
+  (0.1ms) rollback transaction
13113
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
13114
+  (0.1ms) begin transaction
13115
+ -----------------------------------------------
13116
+ EmberSerializeTest: test_accepts_async_argument
13117
+ -----------------------------------------------
13118
+  (0.1ms) rollback transaction
13119
+  (0.1ms) begin transaction
13120
+ ------------------------------------------------
13121
+ EmberSerializeTest: test_accepts_engine_argument
13122
+ ------------------------------------------------
13123
+  (0.1ms) rollback transaction
13124
+  (0.1ms) begin transaction
13125
+ ---------------------------------
13126
+ EmberSerializeTest: test_app_name
13127
+ ---------------------------------
13128
+  (0.1ms) rollback transaction
13129
+  (0.1ms) begin transaction
13130
+ -------------------------------------
13131
+ EmberSerializeTest: test_builds_model
13132
+ -------------------------------------
13133
+  (0.1ms) rollback transaction
13134
+  (0.1ms) begin transaction
13135
+ --------------------------------------
13136
+ EmberSerializeTest: test_camelize_name
13137
+ --------------------------------------
13138
+  (0.0ms) rollback transaction
13139
+  (0.1ms) begin transaction
13140
+ --------------------------------------------------------------------------
13141
+ EmberSerializeTest: test_does_not_throw_NameError_on_ApplicationSerializer
13142
+ --------------------------------------------------------------------------
13143
+  (0.1ms) rollback transaction
13144
+  (0.1ms) begin transaction
13145
+ ------------------------------------
13146
+ EmberSerializeTest: test_ember_model
13147
+ ------------------------------------
13148
+  (0.0ms) rollback transaction
13149
+  (0.0ms) begin transaction
13150
+ ------------------------------------------------
13151
+ EmberSerializeTest: test_ember_reflect_attribute
13152
+ ------------------------------------------------
13153
+  (0.0ms) rollback transaction
13154
+  (0.0ms) begin transaction
13155
+ -------------------------------------------------
13156
+ EmberSerializeTest: test_ember_reflect_belongs_to
13157
+ -------------------------------------------------
13158
+  (0.1ms) rollback transaction
13159
+  (0.0ms) begin transaction
13160
+ -----------------------------------------------
13161
+ EmberSerializeTest: test_ember_reflect_has_many
13162
+ -----------------------------------------------
13163
+  (0.1ms) rollback transaction
13164
+  (0.0ms) begin transaction
13165
+ ----------------------------------
13166
+ EmberSerializeTest: test_existence
13167
+ ----------------------------------
13168
+  (0.0ms) rollback transaction
13169
+  (0.0ms) begin transaction
13170
+ ----------------------------------
13171
+ EmberSerializeTest: test_ignore_id
13172
+ ----------------------------------
13173
+  (0.2ms) rollback transaction
13174
+  (0.1ms) begin transaction
13175
+ -----------------------------------
13176
+ EmberSerializeTest: test_initialize
13177
+ -----------------------------------
13178
+  (0.1ms) rollback transaction
13179
+  (0.0ms) begin transaction
13180
+ ----------------------------------------------
13181
+ EmberSerializeTest: test_makes_model_directory
13182
+ ----------------------------------------------
13183
+  (81.2ms) rollback transaction
13184
+  (0.0ms) begin transaction
13185
+ ----------------------------------------------
13186
+ EmberSerializeTest: test_parses_async_argument
13187
+ ----------------------------------------------
13188
+  (0.1ms) rollback transaction
13189
+  (0.0ms) begin transaction
13190
+ -------------------------------------
13191
+ EmberSerializeTest: test_parses_model
13192
+ -------------------------------------
13193
+  (0.1ms) rollback transaction
13194
+  (0.1ms) begin transaction
13195
+ ------------------------------------------------
13196
+ EmberSerializeTest: test_serialize_as_is_setting
13197
+ ------------------------------------------------
13198
+  (0.1ms) rollback transaction
13199
+  (0.1ms) begin transaction
13200
+ -----------------------------------------------------
13201
+ EmberSerializeTest: test_serialize_finds_associations
13202
+ -----------------------------------------------------
13203
+  (0.1ms) rollback transaction
13204
+  (0.1ms) begin transaction
13205
+ -------------------------------------------------
13206
+ EmberSerializeTest: test_serialize_finds_existing
13207
+ -------------------------------------------------
13208
+  (0.1ms) rollback transaction
13209
+  (0.0ms) begin transaction
13210
+ -------------------------------------------------
13211
+ EmberSerializeTest: test_serialize_ignore_setting
13212
+ -------------------------------------------------
13213
+  (0.1ms) rollback transaction
13214
+  (0.0ms) begin transaction
13215
+ --------------------------------------------------
13216
+ EmberSerializeTest: test_serialize_ignores_outside
13217
+ --------------------------------------------------
13218
+  (0.1ms) rollback transaction
13219
+  (0.1ms) begin transaction
13220
+ ---------------------------------------------------
13221
+ EmberSerializeTest: test_serializes_match_parameter
13222
+ ---------------------------------------------------
13223
+  (0.1ms) rollback transaction
13224
+  (0.0ms) begin transaction
13225
+ ------------------------------------------------
13226
+ EmberSerializeTest: test_skips_or_creates_models
13227
+ ------------------------------------------------
13228
+  (0.1ms) rollback transaction
13229
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
13230
+  (0.1ms) begin transaction
13231
+ -----------------------------------------------
13232
+ EmberSerializeTest: test_accepts_async_argument
13233
+ -----------------------------------------------
13234
+  (0.1ms) rollback transaction
13235
+  (0.1ms) begin transaction
13236
+ ------------------------------------------------
13237
+ EmberSerializeTest: test_accepts_engine_argument
13238
+ ------------------------------------------------
13239
+  (0.1ms) rollback transaction
13240
+  (0.0ms) begin transaction
13241
+ ---------------------------------
13242
+ EmberSerializeTest: test_app_name
13243
+ ---------------------------------
13244
+  (0.0ms) rollback transaction
13245
+  (0.0ms) begin transaction
13246
+ -------------------------------------
13247
+ EmberSerializeTest: test_builds_model
13248
+ -------------------------------------
13249
+  (0.1ms) rollback transaction
13250
+  (0.1ms) begin transaction
13251
+ --------------------------------------
13252
+ EmberSerializeTest: test_camelize_name
13253
+ --------------------------------------
13254
+  (0.1ms) rollback transaction
13255
+  (0.0ms) begin transaction
13256
+ --------------------------------------------------------------------------
13257
+ EmberSerializeTest: test_does_not_throw_NameError_on_ApplicationSerializer
13258
+ --------------------------------------------------------------------------
13259
+  (0.1ms) rollback transaction
13260
+  (0.1ms) begin transaction
13261
+ ------------------------------------
13262
+ EmberSerializeTest: test_ember_model
13263
+ ------------------------------------
13264
+  (0.1ms) rollback transaction
13265
+  (0.1ms) begin transaction
13266
+ ------------------------------------------------
13267
+ EmberSerializeTest: test_ember_reflect_attribute
13268
+ ------------------------------------------------
13269
+  (0.1ms) rollback transaction
13270
+  (0.1ms) begin transaction
13271
+ -------------------------------------------------
13272
+ EmberSerializeTest: test_ember_reflect_belongs_to
13273
+ -------------------------------------------------
13274
+  (0.1ms) rollback transaction
13275
+  (0.0ms) begin transaction
13276
+ -----------------------------------------------
13277
+ EmberSerializeTest: test_ember_reflect_has_many
13278
+ -----------------------------------------------
13279
+  (0.1ms) rollback transaction
13280
+  (0.1ms) begin transaction
13281
+ ----------------------------------
13282
+ EmberSerializeTest: test_existence
13283
+ ----------------------------------
13284
+  (0.1ms) rollback transaction
13285
+  (0.1ms) begin transaction
13286
+ ----------------------------------
13287
+ EmberSerializeTest: test_ignore_id
13288
+ ----------------------------------
13289
+  (0.1ms) rollback transaction
13290
+  (0.1ms) begin transaction
13291
+ -----------------------------------
13292
+ EmberSerializeTest: test_initialize
13293
+ -----------------------------------
13294
+  (0.1ms) rollback transaction
13295
+  (0.0ms) begin transaction
13296
+ ----------------------------------------------
13297
+ EmberSerializeTest: test_makes_model_directory
13298
+ ----------------------------------------------
13299
+  (0.1ms) rollback transaction
13300
+  (0.1ms) begin transaction
13301
+ ----------------------------------------------
13302
+ EmberSerializeTest: test_parses_async_argument
13303
+ ----------------------------------------------
13304
+  (0.1ms) rollback transaction
13305
+  (0.1ms) begin transaction
13306
+ -------------------------------------
13307
+ EmberSerializeTest: test_parses_model
13308
+ -------------------------------------
13309
+  (0.1ms) rollback transaction
13310
+  (0.1ms) begin transaction
13311
+ ------------------------------------------------
13312
+ EmberSerializeTest: test_serialize_as_is_setting
13313
+ ------------------------------------------------
13314
+  (0.1ms) rollback transaction
13315
+  (0.1ms) begin transaction
13316
+ -----------------------------------------------------
13317
+ EmberSerializeTest: test_serialize_finds_associations
13318
+ -----------------------------------------------------
13319
+  (0.1ms) rollback transaction
13320
+  (0.1ms) begin transaction
13321
+ -------------------------------------------------
13322
+ EmberSerializeTest: test_serialize_finds_existing
13323
+ -------------------------------------------------
13324
+  (0.1ms) rollback transaction
13325
+  (0.0ms) begin transaction
13326
+ -------------------------------------------------
13327
+ EmberSerializeTest: test_serialize_ignore_setting
13328
+ -------------------------------------------------
13329
+  (0.1ms) rollback transaction
13330
+  (0.0ms) begin transaction
13331
+ --------------------------------------------------
13332
+ EmberSerializeTest: test_serialize_ignores_outside
13333
+ --------------------------------------------------
13334
+  (0.1ms) rollback transaction
13335
+  (0.0ms) begin transaction
13336
+ ---------------------------------------------------
13337
+ EmberSerializeTest: test_serializes_match_parameter
13338
+ ---------------------------------------------------
13339
+  (0.1ms) rollback transaction
13340
+  (0.0ms) begin transaction
13341
+ ------------------------------------------------
13342
+ EmberSerializeTest: test_skips_or_creates_models
13343
+ ------------------------------------------------
13344
+  (0.1ms) rollback transaction
13345
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
13346
+  (0.1ms) begin transaction
13347
+ -----------------------------------------------
13348
+ EmberSerializeTest: test_accepts_async_argument
13349
+ -----------------------------------------------
13350
+  (0.1ms) rollback transaction
13351
+  (0.1ms) begin transaction
13352
+ ------------------------------------------------
13353
+ EmberSerializeTest: test_accepts_engine_argument
13354
+ ------------------------------------------------
13355
+  (0.1ms) rollback transaction
13356
+  (0.1ms) begin transaction
13357
+ ---------------------------------
13358
+ EmberSerializeTest: test_app_name
13359
+ ---------------------------------
13360
+  (0.1ms) rollback transaction
13361
+  (0.1ms) begin transaction
13362
+ -------------------------------------
13363
+ EmberSerializeTest: test_builds_model
13364
+ -------------------------------------
13365
+  (0.1ms) rollback transaction
13366
+  (0.0ms) begin transaction
13367
+ --------------------------------------
13368
+ EmberSerializeTest: test_camelize_name
13369
+ --------------------------------------
13370
+  (0.0ms) rollback transaction
13371
+  (0.0ms) begin transaction
13372
+ --------------------------------------------------------------------------
13373
+ EmberSerializeTest: test_does_not_throw_NameError_on_ApplicationSerializer
13374
+ --------------------------------------------------------------------------
13375
+  (0.1ms) rollback transaction
13376
+  (0.1ms) begin transaction
13377
+ ------------------------------------
13378
+ EmberSerializeTest: test_ember_model
13379
+ ------------------------------------
13380
+  (0.1ms) rollback transaction
13381
+  (0.0ms) begin transaction
13382
+ ------------------------------------------------
13383
+ EmberSerializeTest: test_ember_reflect_attribute
13384
+ ------------------------------------------------
13385
+  (0.1ms) rollback transaction
13386
+  (0.0ms) begin transaction
13387
+ -------------------------------------------------
13388
+ EmberSerializeTest: test_ember_reflect_belongs_to
13389
+ -------------------------------------------------
13390
+  (0.1ms) rollback transaction
13391
+  (0.1ms) begin transaction
13392
+ -----------------------------------------------
13393
+ EmberSerializeTest: test_ember_reflect_has_many
13394
+ -----------------------------------------------
13395
+  (0.1ms) rollback transaction
13396
+  (0.1ms) begin transaction
13397
+ ----------------------------------
13398
+ EmberSerializeTest: test_existence
13399
+ ----------------------------------
13400
+  (0.0ms) rollback transaction
13401
+  (0.0ms) begin transaction
13402
+ ----------------------------------
13403
+ EmberSerializeTest: test_ignore_id
13404
+ ----------------------------------
13405
+  (0.1ms) rollback transaction
13406
+  (0.0ms) begin transaction
13407
+ -----------------------------------
13408
+ EmberSerializeTest: test_initialize
13409
+ -----------------------------------
13410
+  (0.0ms) rollback transaction
13411
+  (0.1ms) begin transaction
13412
+ ----------------------------------------------
13413
+ EmberSerializeTest: test_makes_model_directory
13414
+ ----------------------------------------------
13415
+  (0.0ms) rollback transaction
13416
+  (0.0ms) begin transaction
13417
+ ----------------------------------------------
13418
+ EmberSerializeTest: test_parses_async_argument
13419
+ ----------------------------------------------
13420
+  (0.1ms) rollback transaction
13421
+  (0.0ms) begin transaction
13422
+ -------------------------------------
13423
+ EmberSerializeTest: test_parses_model
13424
+ -------------------------------------
13425
+  (0.1ms) rollback transaction
13426
+  (0.0ms) begin transaction
13427
+ ------------------------------------------------
13428
+ EmberSerializeTest: test_serialize_as_is_setting
13429
+ ------------------------------------------------
13430
+  (0.1ms) rollback transaction
13431
+  (0.0ms) begin transaction
13432
+ -----------------------------------------------------
13433
+ EmberSerializeTest: test_serialize_finds_associations
13434
+ -----------------------------------------------------
13435
+  (0.1ms) rollback transaction
13436
+  (0.0ms) begin transaction
13437
+ -------------------------------------------------
13438
+ EmberSerializeTest: test_serialize_finds_existing
13439
+ -------------------------------------------------
13440
+  (0.1ms) rollback transaction
13441
+  (0.0ms) begin transaction
13442
+ -------------------------------------------------
13443
+ EmberSerializeTest: test_serialize_ignore_setting
13444
+ -------------------------------------------------
13445
+  (0.1ms) rollback transaction
13446
+  (0.1ms) begin transaction
13447
+ --------------------------------------------------
13448
+ EmberSerializeTest: test_serialize_ignores_outside
13449
+ --------------------------------------------------
13450
+  (0.1ms) rollback transaction
13451
+  (0.0ms) begin transaction
13452
+ ---------------------------------------------------
13453
+ EmberSerializeTest: test_serializes_match_parameter
13454
+ ---------------------------------------------------
13455
+  (0.0ms) rollback transaction
13456
+  (0.0ms) begin transaction
13457
+ ------------------------------------------------
13458
+ EmberSerializeTest: test_skips_or_creates_models
12763
13459
  ------------------------------------------------
12764
13460
   (0.1ms) rollback transaction
@@ -121,7 +121,7 @@ WITHOUTEM
121
121
 
122
122
  test "parses model" do
123
123
  revert_models
124
- match = [["# for more details see: http://emberjs.com/guides/models/defining-models/", "", "EmberSerialize.Post = DS.Model.extend", " # ember_serialize:start", " id: DS.attr('integer'),", " title: DS.attr('string'),", " body: DS.attr('text'),", " comments: DS.hasMany('comments')", " # ember_serialize:end"], 3, 8, {"id"=>" id: DS.attr('integer')", "title"=>" title: DS.attr('string')", "body"=>" body: DS.attr('text')", "comments"=>" comments: DS.hasMany('comments')"}, [], [], true, " "]
124
+ 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, " "]
125
125
  result = @serializer.ember_model_parse "#{@mdir}post.js.coffee", Post
126
126
  assert_equal match, result, 'ember_model_parse'
127
127
  end
@@ -134,7 +134,6 @@ WITHOUTEM
134
134
  EmberSerialize.Post = DS.Model.extend
135
135
  # ember_serialize:start
136
136
  # ember_serialize:async false
137
- id: DS.attr('integer'),
138
137
  title: DS.attr('string'),
139
138
  body: DS.attr('text'),
140
139
  authorDude: DS.belongsTo('user'),
@@ -179,6 +178,13 @@ EmberSerialize.Post = DS.Model.extend
179
178
  assert_equal " postId: DS.attr('integer'),\n", read_model('comment', /postId:/), 'as_is setting'
180
179
  end
181
180
 
181
+ test "ignore id" do
182
+ revert_models
183
+ prep_model 'ignore_id', 'post'
184
+ @serializer.serialize
185
+ assert_equal nil, read_model('post', /\sid:/), 'ignore_id setting'
186
+ end
187
+
182
188
  test "serialize finds associations" do
183
189
  revert_models
184
190
  File.unlink "#{@mdir}post.js.coffee"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ember_serialize
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Noel Peden
@@ -122,6 +122,7 @@ files:
122
122
  - test/dummy/app/assets/javascripts/models/tests/async_parse.js.coffee
123
123
  - test/dummy/app/assets/javascripts/models/tests/find_existing.js.coffee
124
124
  - test/dummy/app/assets/javascripts/models/tests/ignore.js.coffee
125
+ - test/dummy/app/assets/javascripts/models/tests/ignore_id.js.coffee
125
126
  - test/dummy/app/assets/javascripts/models/tests/ignore_outside.js.coffee
126
127
  - test/dummy/app/assets/javascripts/models/user.js.coffee
127
128
  - test/dummy/app/assets/stylesheets/application.css
@@ -212,6 +213,7 @@ test_files:
212
213
  - test/dummy/app/assets/javascripts/models/tests/async_parse.js.coffee
213
214
  - test/dummy/app/assets/javascripts/models/tests/find_existing.js.coffee
214
215
  - test/dummy/app/assets/javascripts/models/tests/ignore.js.coffee
216
+ - test/dummy/app/assets/javascripts/models/tests/ignore_id.js.coffee
215
217
  - test/dummy/app/assets/javascripts/models/tests/ignore_outside.js.coffee
216
218
  - test/dummy/app/assets/javascripts/models/user.js.coffee
217
219
  - test/dummy/app/assets/stylesheets/application.css