ember_serialize 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ember_serialize/version.rb +1 -1
- data/lib/ember_serialize.rb +7 -2
- data/test/dummy/app/serializers/application_serializer.rb +3 -0
- data/test/dummy/app/serializers/comment_serializer.rb +1 -1
- data/test/dummy/app/serializers/post_serializer.rb +1 -1
- data/test/dummy/app/serializers/user_serializer.rb +1 -1
- data/test/dummy/log/test.log +439 -0
- data/test/ember_serialize_test.rb +9 -1
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a63e00e60fd0504935cc7d5d6295b3a063e09bf6
|
4
|
+
data.tar.gz: 0df2489b9ca6599caa25074e2b7e754d211e9931
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7e79e24606521a5bf1348960d0fcff493a6c4d26916a0a82d69ebb2403b629ec1cf9f75afe39fc7d5cd43d0c010d662208fb18d2c59616ee5c364bbf039f22f9
|
7
|
+
data.tar.gz: f4f5abeb10131ee42b2f1478db29a0f73d669b6be5b746d46cfb853e2f3287e20eb1bdb40326130f9b53bfbc7d4811b3a29dfede6abc553911283788100a90b7
|
data/lib/ember_serialize.rb
CHANGED
@@ -45,8 +45,9 @@ module EmberSerialize
|
|
45
45
|
if match
|
46
46
|
next unless serializer.name =~ /^#{match}/
|
47
47
|
end
|
48
|
-
schema = schema serializer
|
49
48
|
model = model_class serializer
|
49
|
+
next unless model
|
50
|
+
schema = schema serializer
|
50
51
|
ember_model_file = @models_dir + model.table_name.singularize + @extension
|
51
52
|
new_content = ember_model_build(schema, model, ember_model_parse(ember_model_file, model))
|
52
53
|
if new_content
|
@@ -228,7 +229,11 @@ MODEL
|
|
228
229
|
|
229
230
|
def model_class(serializer)
|
230
231
|
if serializer.respond_to? :model_class
|
231
|
-
|
232
|
+
begin
|
233
|
+
return serializer.model_class
|
234
|
+
rescue NameError
|
235
|
+
return nil
|
236
|
+
end
|
232
237
|
end
|
233
238
|
@model_classes ||= Hash.new do |h,k|
|
234
239
|
h[k] = k.name.gsub(/Serializer$/,'').constantize
|
data/test/dummy/log/test.log
CHANGED
@@ -12323,3 +12323,442 @@ EmberSerializeTest: test_serializes_match_parameter
|
|
12323
12323
|
EmberSerializeTest: test_skips_or_creates_models
|
12324
12324
|
------------------------------------------------
|
12325
12325
|
[1m[36m (0.2ms)[0m [1mrollback transaction[0m
|
12326
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
12327
|
+
[1m[35m (0.1ms)[0m begin transaction
|
12328
|
+
-----------------------------------------------
|
12329
|
+
EmberSerializeTest: test_accepts_async_argument
|
12330
|
+
-----------------------------------------------
|
12331
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
12332
|
+
[1m[35m (0.0ms)[0m begin transaction
|
12333
|
+
------------------------------------------------
|
12334
|
+
EmberSerializeTest: test_accepts_engine_argument
|
12335
|
+
------------------------------------------------
|
12336
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
12337
|
+
[1m[35m (0.0ms)[0m begin transaction
|
12338
|
+
---------------------------------
|
12339
|
+
EmberSerializeTest: test_app_name
|
12340
|
+
---------------------------------
|
12341
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
12342
|
+
[1m[35m (0.1ms)[0m begin transaction
|
12343
|
+
-------------------------------------
|
12344
|
+
EmberSerializeTest: test_builds_model
|
12345
|
+
-------------------------------------
|
12346
|
+
[1m[36m (0.2ms)[0m [1mrollback transaction[0m
|
12347
|
+
[1m[35m (0.1ms)[0m begin transaction
|
12348
|
+
--------------------------------------
|
12349
|
+
EmberSerializeTest: test_camelize_name
|
12350
|
+
--------------------------------------
|
12351
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
12352
|
+
[1m[35m (0.0ms)[0m begin transaction
|
12353
|
+
------------------------------------
|
12354
|
+
EmberSerializeTest: test_ember_model
|
12355
|
+
------------------------------------
|
12356
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
12357
|
+
[1m[35m (0.1ms)[0m begin transaction
|
12358
|
+
------------------------------------------------
|
12359
|
+
EmberSerializeTest: test_ember_reflect_attribute
|
12360
|
+
------------------------------------------------
|
12361
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
12362
|
+
[1m[35m (0.0ms)[0m begin transaction
|
12363
|
+
-------------------------------------------------
|
12364
|
+
EmberSerializeTest: test_ember_reflect_belongs_to
|
12365
|
+
-------------------------------------------------
|
12366
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
12367
|
+
[1m[35m (0.1ms)[0m begin transaction
|
12368
|
+
-----------------------------------------------
|
12369
|
+
EmberSerializeTest: test_ember_reflect_has_many
|
12370
|
+
-----------------------------------------------
|
12371
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
12372
|
+
[1m[35m (0.1ms)[0m begin transaction
|
12373
|
+
----------------------------------
|
12374
|
+
EmberSerializeTest: test_existence
|
12375
|
+
----------------------------------
|
12376
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
12377
|
+
[1m[35m (0.0ms)[0m begin transaction
|
12378
|
+
-----------------------------------
|
12379
|
+
EmberSerializeTest: test_initialize
|
12380
|
+
-----------------------------------
|
12381
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
12382
|
+
[1m[35m (0.1ms)[0m begin transaction
|
12383
|
+
----------------------------------------------
|
12384
|
+
EmberSerializeTest: test_makes_model_directory
|
12385
|
+
----------------------------------------------
|
12386
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
12387
|
+
[1m[35m (0.0ms)[0m begin transaction
|
12388
|
+
----------------------------------------------
|
12389
|
+
EmberSerializeTest: test_parses_async_argument
|
12390
|
+
----------------------------------------------
|
12391
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
12392
|
+
[1m[35m (0.1ms)[0m begin transaction
|
12393
|
+
-------------------------------------
|
12394
|
+
EmberSerializeTest: test_parses_model
|
12395
|
+
-------------------------------------
|
12396
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
12397
|
+
[1m[35m (0.1ms)[0m begin transaction
|
12398
|
+
------------------------------------------------
|
12399
|
+
EmberSerializeTest: test_serialize_as_is_setting
|
12400
|
+
------------------------------------------------
|
12401
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
12402
|
+
[1m[35m (0.1ms)[0m begin transaction
|
12403
|
+
-----------------------------------------------------
|
12404
|
+
EmberSerializeTest: test_serialize_finds_associations
|
12405
|
+
-----------------------------------------------------
|
12406
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
12407
|
+
[1m[35m (0.1ms)[0m begin transaction
|
12408
|
+
-------------------------------------------------
|
12409
|
+
EmberSerializeTest: test_serialize_finds_existing
|
12410
|
+
-------------------------------------------------
|
12411
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
12412
|
+
[1m[35m (0.1ms)[0m begin transaction
|
12413
|
+
-------------------------------------------------
|
12414
|
+
EmberSerializeTest: test_serialize_ignore_setting
|
12415
|
+
-------------------------------------------------
|
12416
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
12417
|
+
[1m[35m (0.1ms)[0m begin transaction
|
12418
|
+
--------------------------------------------------
|
12419
|
+
EmberSerializeTest: test_serialize_ignores_outside
|
12420
|
+
--------------------------------------------------
|
12421
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
12422
|
+
[1m[35m (0.1ms)[0m begin transaction
|
12423
|
+
---------------------------------------------------
|
12424
|
+
EmberSerializeTest: test_serializes_match_parameter
|
12425
|
+
---------------------------------------------------
|
12426
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
12427
|
+
[1m[35m (0.1ms)[0m begin transaction
|
12428
|
+
------------------------------------------------
|
12429
|
+
EmberSerializeTest: test_skips_or_creates_models
|
12430
|
+
------------------------------------------------
|
12431
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
12432
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
12433
|
+
[1m[35m (0.1ms)[0m begin transaction
|
12434
|
+
-----------------------------------------------
|
12435
|
+
EmberSerializeTest: test_accepts_async_argument
|
12436
|
+
-----------------------------------------------
|
12437
|
+
[1m[36m (0.2ms)[0m [1mrollback transaction[0m
|
12438
|
+
[1m[35m (0.1ms)[0m begin transaction
|
12439
|
+
------------------------------------------------
|
12440
|
+
EmberSerializeTest: test_accepts_engine_argument
|
12441
|
+
------------------------------------------------
|
12442
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
12443
|
+
[1m[35m (0.1ms)[0m begin transaction
|
12444
|
+
---------------------------------
|
12445
|
+
EmberSerializeTest: test_app_name
|
12446
|
+
---------------------------------
|
12447
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
12448
|
+
[1m[35m (0.1ms)[0m begin transaction
|
12449
|
+
-------------------------------------
|
12450
|
+
EmberSerializeTest: test_builds_model
|
12451
|
+
-------------------------------------
|
12452
|
+
[1m[36m (0.2ms)[0m [1mrollback transaction[0m
|
12453
|
+
[1m[35m (0.1ms)[0m begin transaction
|
12454
|
+
--------------------------------------
|
12455
|
+
EmberSerializeTest: test_camelize_name
|
12456
|
+
--------------------------------------
|
12457
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
12458
|
+
[1m[35m (0.1ms)[0m begin transaction
|
12459
|
+
--------------------------------------------------------------------------
|
12460
|
+
EmberSerializeTest: test_does_not_throw_NameError_on_ApplicationSerializer
|
12461
|
+
--------------------------------------------------------------------------
|
12462
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
12463
|
+
[1m[35m (0.1ms)[0m begin transaction
|
12464
|
+
------------------------------------
|
12465
|
+
EmberSerializeTest: test_ember_model
|
12466
|
+
------------------------------------
|
12467
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
12468
|
+
[1m[35m (0.0ms)[0m begin transaction
|
12469
|
+
------------------------------------------------
|
12470
|
+
EmberSerializeTest: test_ember_reflect_attribute
|
12471
|
+
------------------------------------------------
|
12472
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
12473
|
+
[1m[35m (0.1ms)[0m begin transaction
|
12474
|
+
-------------------------------------------------
|
12475
|
+
EmberSerializeTest: test_ember_reflect_belongs_to
|
12476
|
+
-------------------------------------------------
|
12477
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
12478
|
+
[1m[35m (0.1ms)[0m begin transaction
|
12479
|
+
-----------------------------------------------
|
12480
|
+
EmberSerializeTest: test_ember_reflect_has_many
|
12481
|
+
-----------------------------------------------
|
12482
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
12483
|
+
[1m[35m (0.0ms)[0m begin transaction
|
12484
|
+
----------------------------------
|
12485
|
+
EmberSerializeTest: test_existence
|
12486
|
+
----------------------------------
|
12487
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
12488
|
+
[1m[35m (0.1ms)[0m begin transaction
|
12489
|
+
-----------------------------------
|
12490
|
+
EmberSerializeTest: test_initialize
|
12491
|
+
-----------------------------------
|
12492
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
12493
|
+
[1m[35m (0.0ms)[0m begin transaction
|
12494
|
+
----------------------------------------------
|
12495
|
+
EmberSerializeTest: test_makes_model_directory
|
12496
|
+
----------------------------------------------
|
12497
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
12498
|
+
[1m[35m (0.0ms)[0m begin transaction
|
12499
|
+
----------------------------------------------
|
12500
|
+
EmberSerializeTest: test_parses_async_argument
|
12501
|
+
----------------------------------------------
|
12502
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
12503
|
+
[1m[35m (0.0ms)[0m begin transaction
|
12504
|
+
-------------------------------------
|
12505
|
+
EmberSerializeTest: test_parses_model
|
12506
|
+
-------------------------------------
|
12507
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
12508
|
+
[1m[35m (0.1ms)[0m begin transaction
|
12509
|
+
------------------------------------------------
|
12510
|
+
EmberSerializeTest: test_serialize_as_is_setting
|
12511
|
+
------------------------------------------------
|
12512
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
12513
|
+
[1m[35m (0.1ms)[0m begin transaction
|
12514
|
+
-----------------------------------------------------
|
12515
|
+
EmberSerializeTest: test_serialize_finds_associations
|
12516
|
+
-----------------------------------------------------
|
12517
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
12518
|
+
[1m[35m (0.1ms)[0m begin transaction
|
12519
|
+
-------------------------------------------------
|
12520
|
+
EmberSerializeTest: test_serialize_finds_existing
|
12521
|
+
-------------------------------------------------
|
12522
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
12523
|
+
[1m[35m (0.0ms)[0m begin transaction
|
12524
|
+
-------------------------------------------------
|
12525
|
+
EmberSerializeTest: test_serialize_ignore_setting
|
12526
|
+
-------------------------------------------------
|
12527
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
12528
|
+
[1m[35m (0.1ms)[0m begin transaction
|
12529
|
+
--------------------------------------------------
|
12530
|
+
EmberSerializeTest: test_serialize_ignores_outside
|
12531
|
+
--------------------------------------------------
|
12532
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
12533
|
+
[1m[35m (0.1ms)[0m begin transaction
|
12534
|
+
---------------------------------------------------
|
12535
|
+
EmberSerializeTest: test_serializes_match_parameter
|
12536
|
+
---------------------------------------------------
|
12537
|
+
[1m[36m (0.3ms)[0m [1mrollback transaction[0m
|
12538
|
+
[1m[35m (0.1ms)[0m begin transaction
|
12539
|
+
------------------------------------------------
|
12540
|
+
EmberSerializeTest: test_skips_or_creates_models
|
12541
|
+
------------------------------------------------
|
12542
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
12543
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
12544
|
+
[1m[35m (0.1ms)[0m begin transaction
|
12545
|
+
-----------------------------------------------
|
12546
|
+
EmberSerializeTest: test_accepts_async_argument
|
12547
|
+
-----------------------------------------------
|
12548
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
12549
|
+
[1m[35m (0.1ms)[0m begin transaction
|
12550
|
+
------------------------------------------------
|
12551
|
+
EmberSerializeTest: test_accepts_engine_argument
|
12552
|
+
------------------------------------------------
|
12553
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
12554
|
+
[1m[35m (0.1ms)[0m begin transaction
|
12555
|
+
---------------------------------
|
12556
|
+
EmberSerializeTest: test_app_name
|
12557
|
+
---------------------------------
|
12558
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
12559
|
+
[1m[35m (0.0ms)[0m begin transaction
|
12560
|
+
-------------------------------------
|
12561
|
+
EmberSerializeTest: test_builds_model
|
12562
|
+
-------------------------------------
|
12563
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
12564
|
+
[1m[35m (0.2ms)[0m begin transaction
|
12565
|
+
--------------------------------------
|
12566
|
+
EmberSerializeTest: test_camelize_name
|
12567
|
+
--------------------------------------
|
12568
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
12569
|
+
[1m[35m (0.0ms)[0m begin transaction
|
12570
|
+
--------------------------------------------------------------------------
|
12571
|
+
EmberSerializeTest: test_does_not_throw_NameError_on_ApplicationSerializer
|
12572
|
+
--------------------------------------------------------------------------
|
12573
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
12574
|
+
[1m[35m (0.1ms)[0m begin transaction
|
12575
|
+
------------------------------------
|
12576
|
+
EmberSerializeTest: test_ember_model
|
12577
|
+
------------------------------------
|
12578
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
12579
|
+
[1m[35m (0.0ms)[0m begin transaction
|
12580
|
+
------------------------------------------------
|
12581
|
+
EmberSerializeTest: test_ember_reflect_attribute
|
12582
|
+
------------------------------------------------
|
12583
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
12584
|
+
[1m[35m (0.0ms)[0m begin transaction
|
12585
|
+
-------------------------------------------------
|
12586
|
+
EmberSerializeTest: test_ember_reflect_belongs_to
|
12587
|
+
-------------------------------------------------
|
12588
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
12589
|
+
[1m[35m (0.0ms)[0m begin transaction
|
12590
|
+
-----------------------------------------------
|
12591
|
+
EmberSerializeTest: test_ember_reflect_has_many
|
12592
|
+
-----------------------------------------------
|
12593
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
12594
|
+
[1m[35m (0.0ms)[0m begin transaction
|
12595
|
+
----------------------------------
|
12596
|
+
EmberSerializeTest: test_existence
|
12597
|
+
----------------------------------
|
12598
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
12599
|
+
[1m[35m (0.1ms)[0m begin transaction
|
12600
|
+
-----------------------------------
|
12601
|
+
EmberSerializeTest: test_initialize
|
12602
|
+
-----------------------------------
|
12603
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
12604
|
+
[1m[35m (0.0ms)[0m begin transaction
|
12605
|
+
----------------------------------------------
|
12606
|
+
EmberSerializeTest: test_makes_model_directory
|
12607
|
+
----------------------------------------------
|
12608
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
12609
|
+
[1m[35m (0.0ms)[0m begin transaction
|
12610
|
+
----------------------------------------------
|
12611
|
+
EmberSerializeTest: test_parses_async_argument
|
12612
|
+
----------------------------------------------
|
12613
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
12614
|
+
[1m[35m (0.0ms)[0m begin transaction
|
12615
|
+
-------------------------------------
|
12616
|
+
EmberSerializeTest: test_parses_model
|
12617
|
+
-------------------------------------
|
12618
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
12619
|
+
[1m[35m (0.1ms)[0m begin transaction
|
12620
|
+
------------------------------------------------
|
12621
|
+
EmberSerializeTest: test_serialize_as_is_setting
|
12622
|
+
------------------------------------------------
|
12623
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
12624
|
+
[1m[35m (0.1ms)[0m begin transaction
|
12625
|
+
-----------------------------------------------------
|
12626
|
+
EmberSerializeTest: test_serialize_finds_associations
|
12627
|
+
-----------------------------------------------------
|
12628
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
12629
|
+
[1m[35m (0.0ms)[0m begin transaction
|
12630
|
+
-------------------------------------------------
|
12631
|
+
EmberSerializeTest: test_serialize_finds_existing
|
12632
|
+
-------------------------------------------------
|
12633
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
12634
|
+
[1m[35m (0.1ms)[0m begin transaction
|
12635
|
+
-------------------------------------------------
|
12636
|
+
EmberSerializeTest: test_serialize_ignore_setting
|
12637
|
+
-------------------------------------------------
|
12638
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
12639
|
+
[1m[35m (0.1ms)[0m begin transaction
|
12640
|
+
--------------------------------------------------
|
12641
|
+
EmberSerializeTest: test_serialize_ignores_outside
|
12642
|
+
--------------------------------------------------
|
12643
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
12644
|
+
[1m[35m (0.1ms)[0m begin transaction
|
12645
|
+
---------------------------------------------------
|
12646
|
+
EmberSerializeTest: test_serializes_match_parameter
|
12647
|
+
---------------------------------------------------
|
12648
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
12649
|
+
[1m[35m (0.1ms)[0m begin transaction
|
12650
|
+
------------------------------------------------
|
12651
|
+
EmberSerializeTest: test_skips_or_creates_models
|
12652
|
+
------------------------------------------------
|
12653
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
12654
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
12655
|
+
[1m[35m (0.1ms)[0m begin transaction
|
12656
|
+
-----------------------------------------------
|
12657
|
+
EmberSerializeTest: test_accepts_async_argument
|
12658
|
+
-----------------------------------------------
|
12659
|
+
[1m[36m (0.2ms)[0m [1mrollback transaction[0m
|
12660
|
+
[1m[35m (0.1ms)[0m begin transaction
|
12661
|
+
------------------------------------------------
|
12662
|
+
EmberSerializeTest: test_accepts_engine_argument
|
12663
|
+
------------------------------------------------
|
12664
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
12665
|
+
[1m[35m (0.0ms)[0m begin transaction
|
12666
|
+
---------------------------------
|
12667
|
+
EmberSerializeTest: test_app_name
|
12668
|
+
---------------------------------
|
12669
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
12670
|
+
[1m[35m (0.1ms)[0m begin transaction
|
12671
|
+
-------------------------------------
|
12672
|
+
EmberSerializeTest: test_builds_model
|
12673
|
+
-------------------------------------
|
12674
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
12675
|
+
[1m[35m (0.0ms)[0m begin transaction
|
12676
|
+
--------------------------------------
|
12677
|
+
EmberSerializeTest: test_camelize_name
|
12678
|
+
--------------------------------------
|
12679
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
12680
|
+
[1m[35m (0.1ms)[0m begin transaction
|
12681
|
+
--------------------------------------------------------------------------
|
12682
|
+
EmberSerializeTest: test_does_not_throw_NameError_on_ApplicationSerializer
|
12683
|
+
--------------------------------------------------------------------------
|
12684
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
12685
|
+
[1m[35m (0.1ms)[0m begin transaction
|
12686
|
+
------------------------------------
|
12687
|
+
EmberSerializeTest: test_ember_model
|
12688
|
+
------------------------------------
|
12689
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
12690
|
+
[1m[35m (0.0ms)[0m begin transaction
|
12691
|
+
------------------------------------------------
|
12692
|
+
EmberSerializeTest: test_ember_reflect_attribute
|
12693
|
+
------------------------------------------------
|
12694
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
12695
|
+
[1m[35m (0.1ms)[0m begin transaction
|
12696
|
+
-------------------------------------------------
|
12697
|
+
EmberSerializeTest: test_ember_reflect_belongs_to
|
12698
|
+
-------------------------------------------------
|
12699
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
12700
|
+
[1m[35m (0.1ms)[0m begin transaction
|
12701
|
+
-----------------------------------------------
|
12702
|
+
EmberSerializeTest: test_ember_reflect_has_many
|
12703
|
+
-----------------------------------------------
|
12704
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
12705
|
+
[1m[35m (0.0ms)[0m begin transaction
|
12706
|
+
----------------------------------
|
12707
|
+
EmberSerializeTest: test_existence
|
12708
|
+
----------------------------------
|
12709
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
12710
|
+
[1m[35m (0.1ms)[0m begin transaction
|
12711
|
+
-----------------------------------
|
12712
|
+
EmberSerializeTest: test_initialize
|
12713
|
+
-----------------------------------
|
12714
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
12715
|
+
[1m[35m (0.1ms)[0m begin transaction
|
12716
|
+
----------------------------------------------
|
12717
|
+
EmberSerializeTest: test_makes_model_directory
|
12718
|
+
----------------------------------------------
|
12719
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
12720
|
+
[1m[35m (0.1ms)[0m begin transaction
|
12721
|
+
----------------------------------------------
|
12722
|
+
EmberSerializeTest: test_parses_async_argument
|
12723
|
+
----------------------------------------------
|
12724
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
12725
|
+
[1m[35m (0.1ms)[0m begin transaction
|
12726
|
+
-------------------------------------
|
12727
|
+
EmberSerializeTest: test_parses_model
|
12728
|
+
-------------------------------------
|
12729
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
12730
|
+
[1m[35m (0.0ms)[0m begin transaction
|
12731
|
+
------------------------------------------------
|
12732
|
+
EmberSerializeTest: test_serialize_as_is_setting
|
12733
|
+
------------------------------------------------
|
12734
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
12735
|
+
[1m[35m (0.1ms)[0m begin transaction
|
12736
|
+
-----------------------------------------------------
|
12737
|
+
EmberSerializeTest: test_serialize_finds_associations
|
12738
|
+
-----------------------------------------------------
|
12739
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
12740
|
+
[1m[35m (0.0ms)[0m begin transaction
|
12741
|
+
-------------------------------------------------
|
12742
|
+
EmberSerializeTest: test_serialize_finds_existing
|
12743
|
+
-------------------------------------------------
|
12744
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
12745
|
+
[1m[35m (0.0ms)[0m begin transaction
|
12746
|
+
-------------------------------------------------
|
12747
|
+
EmberSerializeTest: test_serialize_ignore_setting
|
12748
|
+
-------------------------------------------------
|
12749
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
12750
|
+
[1m[35m (0.0ms)[0m begin transaction
|
12751
|
+
--------------------------------------------------
|
12752
|
+
EmberSerializeTest: test_serialize_ignores_outside
|
12753
|
+
--------------------------------------------------
|
12754
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
12755
|
+
[1m[35m (0.0ms)[0m begin transaction
|
12756
|
+
---------------------------------------------------
|
12757
|
+
EmberSerializeTest: test_serializes_match_parameter
|
12758
|
+
---------------------------------------------------
|
12759
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
12760
|
+
[1m[35m (0.1ms)[0m begin transaction
|
12761
|
+
------------------------------------------------
|
12762
|
+
EmberSerializeTest: test_skips_or_creates_models
|
12763
|
+
------------------------------------------------
|
12764
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
@@ -127,7 +127,7 @@ WITHOUTEM
|
|
127
127
|
end
|
128
128
|
|
129
129
|
test "builds model" do
|
130
|
-
ams = ActiveModel::Serializer.descendants.sort_by(&:name)[
|
130
|
+
ams = ActiveModel::Serializer.descendants.sort_by(&:name)[2]
|
131
131
|
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, " "]
|
132
132
|
match = "# for more details see: http://emberjs.com/guides/models/defining-models/
|
133
133
|
|
@@ -207,6 +207,14 @@ EmberSerialize.Post = DS.Model.extend
|
|
207
207
|
assert_match /async: true/, lines.grep(/authorDude:/).first, 'accepts async arg'
|
208
208
|
end
|
209
209
|
|
210
|
+
test "does not throw NameError on ApplicationSerializer" do
|
211
|
+
revert_models
|
212
|
+
# this should pass on the ApplicationSerializer
|
213
|
+
assert_nothing_raised NameError do
|
214
|
+
@serializer.serialize
|
215
|
+
end
|
216
|
+
end
|
217
|
+
|
210
218
|
test "parses async argument" do
|
211
219
|
revert_models
|
212
220
|
prep_model 'async_parse', 'post'
|
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.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Noel Peden
|
@@ -131,6 +131,7 @@ files:
|
|
131
131
|
- test/dummy/app/models/comment.rb
|
132
132
|
- test/dummy/app/models/post.rb
|
133
133
|
- test/dummy/app/models/user.rb
|
134
|
+
- test/dummy/app/serializers/application_serializer.rb
|
134
135
|
- test/dummy/app/serializers/comment_serializer.rb
|
135
136
|
- test/dummy/app/serializers/post_serializer.rb
|
136
137
|
- test/dummy/app/serializers/user_serializer.rb
|
@@ -220,6 +221,7 @@ test_files:
|
|
220
221
|
- test/dummy/app/models/comment.rb
|
221
222
|
- test/dummy/app/models/post.rb
|
222
223
|
- test/dummy/app/models/user.rb
|
224
|
+
- test/dummy/app/serializers/application_serializer.rb
|
223
225
|
- test/dummy/app/serializers/comment_serializer.rb
|
224
226
|
- test/dummy/app/serializers/post_serializer.rb
|
225
227
|
- test/dummy/app/serializers/user_serializer.rb
|