listable_collections 0.0.1 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +9 -5
- data/lib/listable_collections/builder.rb +11 -12
- data/lib/listable_collections/version.rb +1 -1
- data/test/association_test.rb +18 -15
- data/test/attribute_test.rb +15 -15
- data/test/dummy/Rakefile +0 -1
- data/test/dummy/app/views/layouts/application.html.erb +9 -11
- data/test/dummy/config/application.rb +2 -4
- data/test/dummy/config/database.yml +2 -5
- data/test/dummy/config/database.yml.travis +2 -9
- data/test/dummy/log/test.log +374 -0
- data/test/test_helper.rb +0 -7
- metadata +4 -10
- data/test/dummy/README.rdoc +0 -28
- data/test/fixtures/products.yml +0 -8
- data/test/fixtures/shops.yml +0 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 98beba0b66e56801103e6edf0062ebfa1fc068c7
|
4
|
+
data.tar.gz: b91c6d3017823ed91e899b60a6b81b599d64748a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 95e85d86a9abf1fb8434210bf844974e9f713b855d497f93666b7b07491fb085ba85677bb81fd7bc5c318e7e304ffb43a32b95317ba28bca956303f711083b88
|
7
|
+
data.tar.gz: 365f41addc1726642e7dcbd938067a3093f20eb7e0abfc21638c1329f65b3657e2604fab5fd5460f84a40b6ad51940d24421b9ab9fa59f66b05b4c279942770e
|
data/README.md
CHANGED
@@ -21,9 +21,9 @@ $ bundle
|
|
21
21
|
|
22
22
|
## Usage
|
23
23
|
|
24
|
-
|
24
|
+
### Associations
|
25
25
|
|
26
|
-
If you want to list
|
26
|
+
If you want to list a has_many association:
|
27
27
|
```ruby
|
28
28
|
class Shop < ActiveRecord::Base
|
29
29
|
|
@@ -34,7 +34,7 @@ class Shop < ActiveRecord::Base
|
|
34
34
|
end
|
35
35
|
```
|
36
36
|
|
37
|
-
Associated records won't be touched but changes will be tracked using
|
37
|
+
Associated records won't be touched but changes will be tracked using the following helpers:
|
38
38
|
```ruby
|
39
39
|
shop.products.map(&:name) => ['iPhone']
|
40
40
|
shop.product_list => 'iPhone'
|
@@ -46,6 +46,10 @@ shop.added_products_to_list => ['iMac']
|
|
46
46
|
shop.removed_products_from_list => ['iPod']
|
47
47
|
```
|
48
48
|
|
49
|
+
NOTE: Because detecting wich record has been removed by an attribute will fire multiple queries, is recommended do this check before save all at once and not dynamically.
|
50
|
+
|
51
|
+
### Attributes
|
52
|
+
|
49
53
|
If you want to list an array attribute:
|
50
54
|
```ruby
|
51
55
|
class Product < ActiveRecord::Base
|
@@ -57,7 +61,7 @@ class Product < ActiveRecord::Base
|
|
57
61
|
end
|
58
62
|
```
|
59
63
|
|
60
|
-
The attribute will be synced and chances will be tracked using
|
64
|
+
The attribute will be synced and chances will be tracked using the following helpers:
|
61
65
|
```ruby
|
62
66
|
product.sizes => ['64GB']
|
63
67
|
product.size_list => '64GB'
|
@@ -69,7 +73,7 @@ product.added_sizes_to_list => ['128GB']
|
|
69
73
|
product.removed_sizes_from_list => ['64GB']
|
70
74
|
```
|
71
75
|
|
72
|
-
In some cases you may need to run some logic after changes, you can use
|
76
|
+
In some cases you may need to run some logic after changes, you can use callbacks for it:
|
73
77
|
```ruby
|
74
78
|
class Shop < ActiveRecord::Base
|
75
79
|
|
@@ -1,10 +1,11 @@
|
|
1
1
|
module ListableCollections
|
2
2
|
class Builder
|
3
3
|
|
4
|
-
attr_reader :model
|
4
|
+
attr_reader :model, :concern
|
5
5
|
|
6
6
|
def initialize(model)
|
7
7
|
@model = model
|
8
|
+
@concern = Module.new
|
8
9
|
end
|
9
10
|
|
10
11
|
def define(attribute, options)
|
@@ -13,20 +14,18 @@ module ListableCollections
|
|
13
14
|
name = "#{singular}_list"
|
14
15
|
variable = "@#{name}"
|
15
16
|
was = "#{name}_was"
|
16
|
-
if Rails::VERSION::MAJOR == 4 && Rails::VERSION::MINOR < 2
|
17
|
-
model.skip_time_zone_conversion_for_attributes << name.to_sym
|
18
|
-
end
|
19
17
|
model.define_attribute_method name
|
20
18
|
define_list_writer name, variable, attribute, options
|
21
19
|
define_list_reader name, variable, attribute, options
|
22
|
-
|
23
|
-
|
20
|
+
define_added_to_list plural, name, was
|
21
|
+
define_removed_from_list plural, name, was
|
22
|
+
model.include concern
|
24
23
|
end
|
25
24
|
|
26
25
|
private
|
27
26
|
|
28
27
|
def define_list_writer(name, variable, attribute, options)
|
29
|
-
|
28
|
+
concern.class_eval do
|
30
29
|
define_method "#{name}=" do |value|
|
31
30
|
current_values = send(name).split(',')
|
32
31
|
new_values = value.split(',').reject(&:blank?).map(&:strip)
|
@@ -55,7 +54,7 @@ module ListableCollections
|
|
55
54
|
end
|
56
55
|
|
57
56
|
def define_list_reader(name, variable, attribute, options)
|
58
|
-
|
57
|
+
concern.class_eval do
|
59
58
|
define_method name do
|
60
59
|
if list = instance_variable_get(variable)
|
61
60
|
list
|
@@ -71,16 +70,16 @@ module ListableCollections
|
|
71
70
|
end
|
72
71
|
end
|
73
72
|
|
74
|
-
def
|
75
|
-
|
73
|
+
def define_added_to_list(plural, name, was)
|
74
|
+
concern.class_eval do
|
76
75
|
define_method "added_#{plural}_to_list" do
|
77
76
|
send(name).split(',') - send(was).split(',')
|
78
77
|
end
|
79
78
|
end
|
80
79
|
end
|
81
80
|
|
82
|
-
def
|
83
|
-
|
81
|
+
def define_removed_from_list(plural, name, was)
|
82
|
+
concern.class_eval do
|
84
83
|
define_method "removed_#{plural}_from_list" do
|
85
84
|
send(was).split(',') - send(name).split(',')
|
86
85
|
end
|
data/test/association_test.rb
CHANGED
@@ -2,24 +2,27 @@ require 'test_helper'
|
|
2
2
|
|
3
3
|
class AssociationTest < ActiveSupport::TestCase
|
4
4
|
|
5
|
-
test '
|
6
|
-
|
7
|
-
|
5
|
+
test 'methods' do
|
6
|
+
shop = Shop.create
|
7
|
+
%w(iPhone iPad).each do |name|
|
8
|
+
shop.products.create name: name
|
9
|
+
end
|
10
|
+
assert_equal 'iPhone,iPad', shop.product_list
|
8
11
|
|
9
12
|
imac = Product.new(name: 'iMac')
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
assert_equal 'iPhone,iPad,iMac',
|
14
|
-
assert_equal [],
|
15
|
-
assert_equal [],
|
13
|
+
shop.expects(:product_added).never
|
14
|
+
shop.expects(:product_removed).never
|
15
|
+
shop.products << imac
|
16
|
+
assert_equal 'iPhone,iPad,iMac', shop.product_list
|
17
|
+
assert_equal [], shop.added_products_to_list
|
18
|
+
assert_equal [], shop.removed_products_from_list
|
16
19
|
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
assert_equal 'iPhone,iMac,MacBook',
|
21
|
-
assert_equal ['MacBook'],
|
22
|
-
assert_equal ['iPad'],
|
20
|
+
shop.expects(:product_added).once.with('MacBook')
|
21
|
+
shop.expects(:product_removed).once.with('iPad')
|
22
|
+
shop.product_list = 'iMac,iPhone,MacBook'
|
23
|
+
assert_equal 'iPhone,iMac,MacBook', shop.product_list
|
24
|
+
assert_equal ['MacBook'], shop.added_products_to_list
|
25
|
+
assert_equal ['iPad'], shop.removed_products_from_list
|
23
26
|
end
|
24
27
|
|
25
28
|
end
|
data/test/attribute_test.rb
CHANGED
@@ -2,23 +2,23 @@ require 'test_helper'
|
|
2
2
|
|
3
3
|
class AttributeTest < ActiveSupport::TestCase
|
4
4
|
|
5
|
-
test '
|
6
|
-
|
7
|
-
assert_equal '',
|
5
|
+
test 'methods' do
|
6
|
+
product = Product.new
|
7
|
+
assert_equal '', product.size_list
|
8
8
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
assert_equal '64GB',
|
13
|
-
assert_equal [],
|
14
|
-
assert_equal [],
|
9
|
+
product.expects(:size_added).never
|
10
|
+
product.expects(:size_removed).never
|
11
|
+
product.sizes << '64GB'
|
12
|
+
assert_equal '64GB', product.size_list
|
13
|
+
assert_equal [], product.added_sizes_to_list
|
14
|
+
assert_equal [], product.removed_sizes_from_list
|
15
15
|
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
assert_equal '32GB',
|
20
|
-
assert_equal ['32GB'],
|
21
|
-
assert_equal ['64GB'],
|
16
|
+
product.expects(:size_added).once.with('32GB')
|
17
|
+
product.expects(:size_removed).once.with('64GB')
|
18
|
+
product.size_list = '32GB'
|
19
|
+
assert_equal '32GB', product.size_list
|
20
|
+
assert_equal ['32GB'], product.added_sizes_to_list
|
21
|
+
assert_equal ['64GB'], product.removed_sizes_from_list
|
22
22
|
end
|
23
23
|
|
24
24
|
end
|
data/test/dummy/Rakefile
CHANGED
@@ -1,14 +1,12 @@
|
|
1
1
|
<!DOCTYPE html>
|
2
2
|
<html>
|
3
|
-
<head>
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
</head>
|
9
|
-
<body>
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
</body>
|
3
|
+
<head>
|
4
|
+
<title>Dummy</title>
|
5
|
+
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>
|
6
|
+
<%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
|
7
|
+
<%= csrf_meta_tags %>
|
8
|
+
</head>
|
9
|
+
<body>
|
10
|
+
<%= yield %>
|
11
|
+
</body>
|
14
12
|
</html>
|
@@ -19,9 +19,7 @@ module Dummy
|
|
19
19
|
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
|
20
20
|
# config.i18n.default_locale = :de
|
21
21
|
|
22
|
-
|
23
|
-
|
24
|
-
config.active_record.raise_in_transactional_callbacks = true
|
25
|
-
end
|
22
|
+
# Do not swallow errors in after_commit/after_rollback callbacks.
|
23
|
+
config.active_record.raise_in_transactional_callbacks = true
|
26
24
|
end
|
27
25
|
end
|
@@ -7,13 +7,6 @@ postgres: &postgres
|
|
7
7
|
sqlite: &sqlite
|
8
8
|
adapter: <%= 'jdbc' if RUBY_ENGINE == 'jruby' %>sqlite3
|
9
9
|
|
10
|
-
default: &default
|
11
|
-
<<: *<%= ENV['DB'] %>
|
12
|
-
|
13
|
-
development:
|
14
|
-
<<: *default
|
15
|
-
database: travis
|
16
|
-
|
17
10
|
test:
|
18
|
-
<<:
|
19
|
-
database: travis
|
11
|
+
<<: *<%= ENV['DB'] %>
|
12
|
+
database: <%= ENV['DB'] == 'sqlite' ? 'db/travis.sqlite3' : 'travis' %>
|
data/test/dummy/log/test.log
CHANGED
@@ -558,3 +558,377 @@ AttributeTest: test_accessor
|
|
558
558
|
----------------------------
|
559
559
|
[1m[36mProduct Load (0.2ms)[0m [1mSELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1[0m [["id", 1]]
|
560
560
|
[1m[35m (0.2ms)[0m ROLLBACK
|
561
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.9ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
562
|
+
[1m[35m (0.2ms)[0m BEGIN
|
563
|
+
---------------------------
|
564
|
+
AttributeTest: test_methods
|
565
|
+
---------------------------
|
566
|
+
[1m[36m (0.2ms)[0m [1mROLLBACK[0m
|
567
|
+
[1m[35m (0.1ms)[0m BEGIN
|
568
|
+
-----------------------------
|
569
|
+
AssociationTest: test_methods
|
570
|
+
-----------------------------
|
571
|
+
[1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m
|
572
|
+
[1m[35mSQL (0.5ms)[0m INSERT INTO "shops" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2016-09-19 11:25:29.902568"], ["updated_at", "2016-09-19 11:25:29.902568"]]
|
573
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
574
|
+
[1m[35m (0.2ms)[0m SAVEPOINT active_record_1
|
575
|
+
[1m[36mSQL (0.4ms)[0m [1mINSERT INTO "products" ("name", "shop_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["name", "iPhone"], ["shop_id", 690933843], ["created_at", "2016-09-19 11:25:29.921238"], ["updated_at", "2016-09-19 11:25:29.921238"]]
|
576
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
577
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
578
|
+
[1m[35mSQL (0.2ms)[0m INSERT INTO "products" ("name", "shop_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "iPad"], ["shop_id", 690933843], ["created_at", "2016-09-19 11:25:29.923445"], ["updated_at", "2016-09-19 11:25:29.923445"]]
|
579
|
+
[1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
580
|
+
[1m[35mProduct Load (0.3ms)[0m SELECT "products".* FROM "products" WHERE "products"."shop_id" = $1 [["shop_id", 690933843]]
|
581
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
582
|
+
[1m[35mSQL (0.2ms)[0m INSERT INTO "products" ("name", "shop_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "iMac"], ["shop_id", 690933843], ["created_at", "2016-09-19 11:25:29.929045"], ["updated_at", "2016-09-19 11:25:29.929045"]]
|
583
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
584
|
+
[1m[35m (0.2ms)[0m ROLLBACK
|
585
|
+
[1m[36mActiveRecord::SchemaMigration Load (6.9ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
586
|
+
[1m[35m (0.2ms)[0m BEGIN
|
587
|
+
---------------------------
|
588
|
+
AttributeTest: test_methods
|
589
|
+
---------------------------
|
590
|
+
[1m[36m (0.2ms)[0m [1mROLLBACK[0m
|
591
|
+
[1m[35m (0.2ms)[0m BEGIN
|
592
|
+
-----------------------------
|
593
|
+
AssociationTest: test_methods
|
594
|
+
-----------------------------
|
595
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
596
|
+
[1m[35mSQL (0.8ms)[0m INSERT INTO "shops" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2016-09-19 23:10:10.897836"], ["updated_at", "2016-09-19 23:10:10.897836"]]
|
597
|
+
[1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
598
|
+
[1m[35m (0.2ms)[0m SAVEPOINT active_record_1
|
599
|
+
[1m[36mSQL (0.4ms)[0m [1mINSERT INTO "products" ("name", "shop_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["name", "iPhone"], ["shop_id", 690933844], ["created_at", "2016-09-19 23:10:10.920238"], ["updated_at", "2016-09-19 23:10:10.920238"]]
|
600
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
601
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
602
|
+
[1m[35mSQL (0.2ms)[0m INSERT INTO "products" ("name", "shop_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "iPad"], ["shop_id", 690933844], ["created_at", "2016-09-19 23:10:10.922352"], ["updated_at", "2016-09-19 23:10:10.922352"]]
|
603
|
+
[1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
604
|
+
[1m[35mProduct Load (0.4ms)[0m SELECT "products".* FROM "products" WHERE "products"."shop_id" = $1 [["shop_id", 690933844]]
|
605
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
606
|
+
[1m[35mSQL (0.2ms)[0m INSERT INTO "products" ("name", "shop_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "iMac"], ["shop_id", 690933844], ["created_at", "2016-09-19 23:10:10.927548"], ["updated_at", "2016-09-19 23:10:10.927548"]]
|
607
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
608
|
+
[1m[35m (0.2ms)[0m ROLLBACK
|
609
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.4ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
610
|
+
[1m[35m (0.2ms)[0m BEGIN
|
611
|
+
-----------------------------
|
612
|
+
AssociationTest: test_methods
|
613
|
+
-----------------------------
|
614
|
+
[1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m
|
615
|
+
[1m[35mSQL (6.4ms)[0m INSERT INTO "shops" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2016-09-19 23:10:25.274876"], ["updated_at", "2016-09-19 23:10:25.274876"]]
|
616
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
617
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
618
|
+
[1m[36mSQL (0.3ms)[0m [1mINSERT INTO "products" ("name", "shop_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["name", "iPhone"], ["shop_id", 690933845], ["created_at", "2016-09-19 23:10:25.307629"], ["updated_at", "2016-09-19 23:10:25.307629"]]
|
619
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
620
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
621
|
+
[1m[35mSQL (0.2ms)[0m INSERT INTO "products" ("name", "shop_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "iPad"], ["shop_id", 690933845], ["created_at", "2016-09-19 23:10:25.309788"], ["updated_at", "2016-09-19 23:10:25.309788"]]
|
622
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
623
|
+
[1m[35mProduct Load (0.3ms)[0m SELECT "products".* FROM "products" WHERE "products"."shop_id" = $1 [["shop_id", 690933845]]
|
624
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
625
|
+
[1m[35mSQL (0.2ms)[0m INSERT INTO "products" ("name", "shop_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "iMac"], ["shop_id", 690933845], ["created_at", "2016-09-19 23:10:25.316243"], ["updated_at", "2016-09-19 23:10:25.316243"]]
|
626
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
627
|
+
[1m[35m (0.2ms)[0m ROLLBACK
|
628
|
+
[1m[36m (0.1ms)[0m [1mBEGIN[0m
|
629
|
+
---------------------------
|
630
|
+
AttributeTest: test_methods
|
631
|
+
---------------------------
|
632
|
+
[1m[35m (0.2ms)[0m ROLLBACK
|
633
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.3ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
634
|
+
[1m[35m (0.2ms)[0m BEGIN
|
635
|
+
-----------------------------
|
636
|
+
AssociationTest: test_methods
|
637
|
+
-----------------------------
|
638
|
+
[1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m
|
639
|
+
[1m[35mSQL (0.4ms)[0m INSERT INTO "shops" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2016-09-19 23:25:20.902395"], ["updated_at", "2016-09-19 23:25:20.902395"]]
|
640
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
641
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
642
|
+
[1m[36mSQL (0.4ms)[0m [1mINSERT INTO "products" ("name", "shop_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["name", "iPhone"], ["shop_id", 690933846], ["created_at", "2016-09-19 23:25:20.925838"], ["updated_at", "2016-09-19 23:25:20.925838"]]
|
643
|
+
[1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1
|
644
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
645
|
+
[1m[35mSQL (0.2ms)[0m INSERT INTO "products" ("name", "shop_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "iPad"], ["shop_id", 690933846], ["created_at", "2016-09-19 23:25:20.934875"], ["updated_at", "2016-09-19 23:25:20.934875"]]
|
646
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
647
|
+
[1m[35mProduct Load (0.3ms)[0m SELECT "products".* FROM "products" WHERE "products"."shop_id" = $1 [["shop_id", 690933846]]
|
648
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
649
|
+
[1m[35mSQL (0.3ms)[0m INSERT INTO "products" ("name", "shop_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "iMac"], ["shop_id", 690933846], ["created_at", "2016-09-19 23:25:20.940359"], ["updated_at", "2016-09-19 23:25:20.940359"]]
|
650
|
+
[1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
651
|
+
[1m[35m (0.2ms)[0m ROLLBACK
|
652
|
+
[1m[36m (0.1ms)[0m [1mBEGIN[0m
|
653
|
+
---------------------------
|
654
|
+
AttributeTest: test_methods
|
655
|
+
---------------------------
|
656
|
+
[1m[35m (0.1ms)[0m ROLLBACK
|
657
|
+
[1m[36mActiveRecord::SchemaMigration Load (2.6ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
658
|
+
[1m[35m (0.2ms)[0m BEGIN
|
659
|
+
---------------------------
|
660
|
+
AttributeTest: test_methods
|
661
|
+
---------------------------
|
662
|
+
[1m[36m (0.2ms)[0m [1mROLLBACK[0m
|
663
|
+
[1m[35m (0.1ms)[0m BEGIN
|
664
|
+
-----------------------------
|
665
|
+
AssociationTest: test_methods
|
666
|
+
-----------------------------
|
667
|
+
[1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m
|
668
|
+
[1m[35mSQL (19.1ms)[0m INSERT INTO "shops" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2016-10-17 03:05:04.358355"], ["updated_at", "2016-10-17 03:05:04.358355"]]
|
669
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
670
|
+
[1m[35m (0.2ms)[0m SAVEPOINT active_record_1
|
671
|
+
[1m[36mSQL (18.4ms)[0m [1mINSERT INTO "products" ("name", "shop_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["name", "iPhone"], ["shop_id", 2], ["created_at", "2016-10-17 03:05:04.390656"], ["updated_at", "2016-10-17 03:05:04.390656"]]
|
672
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
673
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
674
|
+
[1m[35mSQL (0.2ms)[0m INSERT INTO "products" ("name", "shop_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "iPad"], ["shop_id", 2], ["created_at", "2016-10-17 03:05:04.410985"], ["updated_at", "2016-10-17 03:05:04.410985"]]
|
675
|
+
[1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
676
|
+
[1m[35mProduct Load (0.3ms)[0m SELECT "products".* FROM "products" WHERE "products"."shop_id" = $1 [["shop_id", 2]]
|
677
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
678
|
+
[1m[35mSQL (0.2ms)[0m INSERT INTO "products" ("name", "shop_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "iMac"], ["shop_id", 2], ["created_at", "2016-10-17 03:05:04.415576"], ["updated_at", "2016-10-17 03:05:04.415576"]]
|
679
|
+
[1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
680
|
+
[1m[35m (0.2ms)[0m ROLLBACK
|
681
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.3ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
682
|
+
[1m[35m (0.2ms)[0m BEGIN
|
683
|
+
-----------------------------
|
684
|
+
AssociationTest: test_methods
|
685
|
+
-----------------------------
|
686
|
+
[1m[36m (0.2ms)[0m [1mROLLBACK[0m
|
687
|
+
[1m[35m (0.1ms)[0m BEGIN
|
688
|
+
---------------------------
|
689
|
+
AttributeTest: test_methods
|
690
|
+
---------------------------
|
691
|
+
[1m[36m (0.1ms)[0m [1mROLLBACK[0m
|
692
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.3ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
693
|
+
[1m[35m (0.2ms)[0m BEGIN
|
694
|
+
-----------------------------
|
695
|
+
AssociationTest: test_methods
|
696
|
+
-----------------------------
|
697
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
698
|
+
[1m[35mSQL (0.3ms)[0m INSERT INTO "shops" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2016-10-17 04:06:22.007954"], ["updated_at", "2016-10-17 04:06:22.007954"]]
|
699
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
700
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
701
|
+
[1m[36mSQL (0.3ms)[0m [1mINSERT INTO "products" ("name", "shop_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["name", "iPhone"], ["shop_id", 3], ["created_at", "2016-10-17 04:06:22.026893"], ["updated_at", "2016-10-17 04:06:22.026893"]]
|
702
|
+
[1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1
|
703
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
704
|
+
[1m[35mSQL (0.2ms)[0m INSERT INTO "products" ("name", "shop_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "iPad"], ["shop_id", 3], ["created_at", "2016-10-17 04:06:22.028786"], ["updated_at", "2016-10-17 04:06:22.028786"]]
|
705
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
706
|
+
[1m[35m (0.2ms)[0m ROLLBACK
|
707
|
+
[1m[36m (0.1ms)[0m [1mBEGIN[0m
|
708
|
+
---------------------------
|
709
|
+
AttributeTest: test_methods
|
710
|
+
---------------------------
|
711
|
+
[1m[35m (0.1ms)[0m ROLLBACK
|
712
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.3ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
713
|
+
[1m[35m (0.2ms)[0m BEGIN
|
714
|
+
-----------------------------
|
715
|
+
AssociationTest: test_methods
|
716
|
+
-----------------------------
|
717
|
+
[1m[36m (0.1ms)[0m [1mROLLBACK[0m
|
718
|
+
[1m[35m (0.2ms)[0m BEGIN
|
719
|
+
---------------------------
|
720
|
+
AttributeTest: test_methods
|
721
|
+
---------------------------
|
722
|
+
[1m[36m (0.1ms)[0m [1mROLLBACK[0m
|
723
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.3ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
724
|
+
[1m[35m (0.2ms)[0m BEGIN
|
725
|
+
---------------------------
|
726
|
+
AttributeTest: test_methods
|
727
|
+
---------------------------
|
728
|
+
[1m[36m (0.1ms)[0m [1mROLLBACK[0m
|
729
|
+
[1m[35m (0.1ms)[0m BEGIN
|
730
|
+
-----------------------------
|
731
|
+
AssociationTest: test_methods
|
732
|
+
-----------------------------
|
733
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
734
|
+
[1m[35mSQL (0.3ms)[0m INSERT INTO "shops" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2016-10-17 04:07:53.835060"], ["updated_at", "2016-10-17 04:07:53.835060"]]
|
735
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
736
|
+
[1m[35m (0.2ms)[0m SAVEPOINT active_record_1
|
737
|
+
[1m[36mSQL (0.3ms)[0m [1mINSERT INTO "products" ("name", "shop_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["name", "iPhone"], ["shop_id", 4], ["created_at", "2016-10-17 04:07:53.846004"], ["updated_at", "2016-10-17 04:07:53.846004"]]
|
738
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
739
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
740
|
+
[1m[35mSQL (0.2ms)[0m INSERT INTO "products" ("name", "shop_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "iPad"], ["shop_id", 4], ["created_at", "2016-10-17 04:07:53.847920"], ["updated_at", "2016-10-17 04:07:53.847920"]]
|
741
|
+
[1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
742
|
+
[1m[35mProduct Load (0.3ms)[0m SELECT "products".* FROM "products" WHERE "products"."shop_id" = $1 [["shop_id", 4]]
|
743
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
744
|
+
[1m[35mSQL (0.2ms)[0m INSERT INTO "products" ("name", "shop_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "iMac"], ["shop_id", 4], ["created_at", "2016-10-17 04:07:53.856861"], ["updated_at", "2016-10-17 04:07:53.856861"]]
|
745
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
746
|
+
[1m[35m (0.2ms)[0m ROLLBACK
|
747
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.3ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
748
|
+
[1m[35m (0.2ms)[0m BEGIN
|
749
|
+
-----------------------------
|
750
|
+
AssociationTest: test_methods
|
751
|
+
-----------------------------
|
752
|
+
[1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m
|
753
|
+
[1m[35mSQL (0.3ms)[0m INSERT INTO "shops" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2016-10-17 04:08:07.346275"], ["updated_at", "2016-10-17 04:08:07.346275"]]
|
754
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
755
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
756
|
+
[1m[36mSQL (0.2ms)[0m [1mINSERT INTO "products" ("name", "shop_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["name", "iPhone"], ["shop_id", 5], ["created_at", "2016-10-17 04:08:07.363170"], ["updated_at", "2016-10-17 04:08:07.363170"]]
|
757
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
758
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
759
|
+
[1m[35mSQL (0.2ms)[0m INSERT INTO "products" ("name", "shop_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "iPad"], ["shop_id", 5], ["created_at", "2016-10-17 04:08:07.365017"], ["updated_at", "2016-10-17 04:08:07.365017"]]
|
760
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
761
|
+
[1m[35mProduct Load (0.3ms)[0m SELECT "products".* FROM "products" WHERE "products"."shop_id" = $1 [["shop_id", 5]]
|
762
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
763
|
+
[1m[35mSQL (0.2ms)[0m INSERT INTO "products" ("name", "shop_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "iMac"], ["shop_id", 5], ["created_at", "2016-10-17 04:08:07.368860"], ["updated_at", "2016-10-17 04:08:07.368860"]]
|
764
|
+
[1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
765
|
+
[1m[35m (0.2ms)[0m ROLLBACK
|
766
|
+
[1m[36m (0.1ms)[0m [1mBEGIN[0m
|
767
|
+
---------------------------
|
768
|
+
AttributeTest: test_methods
|
769
|
+
---------------------------
|
770
|
+
[1m[35m (0.2ms)[0m ROLLBACK
|
771
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.3ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
772
|
+
[1m[35m (0.2ms)[0m BEGIN
|
773
|
+
-----------------------------
|
774
|
+
AssociationTest: test_methods
|
775
|
+
-----------------------------
|
776
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
777
|
+
[1m[35mSQL (0.3ms)[0m INSERT INTO "shops" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2016-10-17 04:09:35.257488"], ["updated_at", "2016-10-17 04:09:35.257488"]]
|
778
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
779
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
780
|
+
[1m[36mSQL (0.3ms)[0m [1mINSERT INTO "products" ("name", "shop_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["name", "iPhone"], ["shop_id", 6], ["created_at", "2016-10-17 04:09:35.274223"], ["updated_at", "2016-10-17 04:09:35.274223"]]
|
781
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
782
|
+
[1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m
|
783
|
+
[1m[35mSQL (0.2ms)[0m INSERT INTO "products" ("name", "shop_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "iPad"], ["shop_id", 6], ["created_at", "2016-10-17 04:09:35.276174"], ["updated_at", "2016-10-17 04:09:35.276174"]]
|
784
|
+
[1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
785
|
+
[1m[35mProduct Load (0.2ms)[0m SELECT "products".* FROM "products" WHERE "products"."shop_id" = $1 [["shop_id", 6]]
|
786
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
787
|
+
[1m[35mSQL (0.2ms)[0m INSERT INTO "products" ("name", "shop_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "iMac"], ["shop_id", 6], ["created_at", "2016-10-17 04:09:35.279958"], ["updated_at", "2016-10-17 04:09:35.279958"]]
|
788
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
789
|
+
[1m[35m (0.2ms)[0m ROLLBACK
|
790
|
+
[1m[36m (0.3ms)[0m [1mBEGIN[0m
|
791
|
+
---------------------------
|
792
|
+
AttributeTest: test_methods
|
793
|
+
---------------------------
|
794
|
+
[1m[35m (0.2ms)[0m ROLLBACK
|
795
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.3ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
796
|
+
[1m[35m (0.2ms)[0m BEGIN
|
797
|
+
-----------------------------
|
798
|
+
AssociationTest: test_methods
|
799
|
+
-----------------------------
|
800
|
+
[1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m
|
801
|
+
[1m[35mSQL (0.3ms)[0m INSERT INTO "shops" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2016-10-17 04:10:10.800180"], ["updated_at", "2016-10-17 04:10:10.800180"]]
|
802
|
+
[1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
803
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
804
|
+
[1m[36mSQL (0.3ms)[0m [1mINSERT INTO "products" ("name", "shop_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["name", "iPhone"], ["shop_id", 7], ["created_at", "2016-10-17 04:10:10.816982"], ["updated_at", "2016-10-17 04:10:10.816982"]]
|
805
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
806
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
807
|
+
[1m[35mSQL (0.2ms)[0m INSERT INTO "products" ("name", "shop_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "iPad"], ["shop_id", 7], ["created_at", "2016-10-17 04:10:10.818802"], ["updated_at", "2016-10-17 04:10:10.818802"]]
|
808
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
809
|
+
[1m[35mProduct Load (0.2ms)[0m SELECT "products".* FROM "products" WHERE "products"."shop_id" = $1 [["shop_id", 7]]
|
810
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
811
|
+
[1m[35mSQL (0.2ms)[0m INSERT INTO "products" ("name", "shop_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "iMac"], ["shop_id", 7], ["created_at", "2016-10-17 04:10:10.822461"], ["updated_at", "2016-10-17 04:10:10.822461"]]
|
812
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
813
|
+
[1m[35m (0.2ms)[0m ROLLBACK
|
814
|
+
[1m[36m (0.1ms)[0m [1mBEGIN[0m
|
815
|
+
---------------------------
|
816
|
+
AttributeTest: test_methods
|
817
|
+
---------------------------
|
818
|
+
[1m[35m (0.3ms)[0m ROLLBACK
|
819
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.3ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
820
|
+
[1m[35m (0.2ms)[0m BEGIN
|
821
|
+
---------------------------
|
822
|
+
AttributeTest: test_methods
|
823
|
+
---------------------------
|
824
|
+
[1m[36m (0.1ms)[0m [1mROLLBACK[0m
|
825
|
+
[1m[35m (0.1ms)[0m BEGIN
|
826
|
+
-----------------------------
|
827
|
+
AssociationTest: test_methods
|
828
|
+
-----------------------------
|
829
|
+
[1m[36m (0.1ms)[0m [1mROLLBACK[0m
|
830
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.3ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
831
|
+
[1m[35m (0.2ms)[0m BEGIN
|
832
|
+
-----------------------------
|
833
|
+
AssociationTest: test_methods
|
834
|
+
-----------------------------
|
835
|
+
[1m[36m (0.2ms)[0m [1mROLLBACK[0m
|
836
|
+
[1m[35m (0.1ms)[0m BEGIN
|
837
|
+
---------------------------
|
838
|
+
AttributeTest: test_methods
|
839
|
+
---------------------------
|
840
|
+
[1m[36m (0.1ms)[0m [1mROLLBACK[0m
|
841
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.3ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
842
|
+
[1m[35m (0.2ms)[0m BEGIN
|
843
|
+
-----------------------------
|
844
|
+
AssociationTest: test_methods
|
845
|
+
-----------------------------
|
846
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
847
|
+
[1m[35mSQL (0.3ms)[0m INSERT INTO "shops" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2016-10-17 04:12:46.752043"], ["updated_at", "2016-10-17 04:12:46.752043"]]
|
848
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
849
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
850
|
+
[1m[36mSQL (0.3ms)[0m [1mINSERT INTO "products" ("name", "shop_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["name", "iPhone"], ["shop_id", 8], ["created_at", "2016-10-17 04:12:46.768606"], ["updated_at", "2016-10-17 04:12:46.768606"]]
|
851
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
852
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
853
|
+
[1m[35mSQL (0.2ms)[0m INSERT INTO "products" ("name", "shop_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "iPad"], ["shop_id", 8], ["created_at", "2016-10-17 04:12:46.770462"], ["updated_at", "2016-10-17 04:12:46.770462"]]
|
854
|
+
[1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
855
|
+
[1m[35mProduct Load (0.2ms)[0m SELECT "products".* FROM "products" WHERE "products"."shop_id" = $1 [["shop_id", 8]]
|
856
|
+
[1m[36m (0.3ms)[0m [1mROLLBACK[0m
|
857
|
+
[1m[35m (0.2ms)[0m BEGIN
|
858
|
+
---------------------------
|
859
|
+
AttributeTest: test_methods
|
860
|
+
---------------------------
|
861
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.4ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
862
|
+
[1m[35m (0.2ms)[0m BEGIN
|
863
|
+
-----------------------------
|
864
|
+
AssociationTest: test_methods
|
865
|
+
-----------------------------
|
866
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
867
|
+
[1m[35mSQL (0.3ms)[0m INSERT INTO "shops" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2016-10-17 04:13:57.769520"], ["updated_at", "2016-10-17 04:13:57.769520"]]
|
868
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
869
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
870
|
+
[1m[36mSQL (0.3ms)[0m [1mINSERT INTO "products" ("name", "shop_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["name", "iPhone"], ["shop_id", 9], ["created_at", "2016-10-17 04:13:57.786723"], ["updated_at", "2016-10-17 04:13:57.786723"]]
|
871
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
872
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
873
|
+
[1m[35mSQL (0.2ms)[0m INSERT INTO "products" ("name", "shop_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "iPad"], ["shop_id", 9], ["created_at", "2016-10-17 04:13:57.788643"], ["updated_at", "2016-10-17 04:13:57.788643"]]
|
874
|
+
[1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
875
|
+
[1m[35mProduct Load (0.2ms)[0m SELECT "products".* FROM "products" WHERE "products"."shop_id" = $1 [["shop_id", 9]]
|
876
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
877
|
+
[1m[35mSQL (0.2ms)[0m INSERT INTO "products" ("name", "shop_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "iMac"], ["shop_id", 9], ["created_at", "2016-10-17 04:13:57.792501"], ["updated_at", "2016-10-17 04:13:57.792501"]]
|
878
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
879
|
+
[1m[35m (0.2ms)[0m ROLLBACK
|
880
|
+
[1m[36m (0.2ms)[0m [1mBEGIN[0m
|
881
|
+
---------------------------
|
882
|
+
AttributeTest: test_methods
|
883
|
+
---------------------------
|
884
|
+
[1m[35m (0.3ms)[0m ROLLBACK
|
885
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.3ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
886
|
+
[1m[35m (0.2ms)[0m BEGIN
|
887
|
+
---------------------------
|
888
|
+
AttributeTest: test_methods
|
889
|
+
---------------------------
|
890
|
+
[1m[36m (0.3ms)[0m [1mROLLBACK[0m
|
891
|
+
[1m[35m (0.1ms)[0m BEGIN
|
892
|
+
-----------------------------
|
893
|
+
AssociationTest: test_methods
|
894
|
+
-----------------------------
|
895
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
896
|
+
[1m[35mSQL (0.5ms)[0m INSERT INTO "shops" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2016-10-17 04:18:18.750434"], ["updated_at", "2016-10-17 04:18:18.750434"]]
|
897
|
+
[1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
898
|
+
[1m[35m (0.2ms)[0m SAVEPOINT active_record_1
|
899
|
+
[1m[36mSQL (0.3ms)[0m [1mINSERT INTO "products" ("name", "shop_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["name", "iPhone"], ["shop_id", 10], ["created_at", "2016-10-17 04:18:18.767311"], ["updated_at", "2016-10-17 04:18:18.767311"]]
|
900
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
901
|
+
[1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m
|
902
|
+
[1m[35mSQL (0.2ms)[0m INSERT INTO "products" ("name", "shop_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "iPad"], ["shop_id", 10], ["created_at", "2016-10-17 04:18:18.769784"], ["updated_at", "2016-10-17 04:18:18.769784"]]
|
903
|
+
[1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
904
|
+
[1m[35mProduct Load (0.2ms)[0m SELECT "products".* FROM "products" WHERE "products"."shop_id" = $1 [["shop_id", 10]]
|
905
|
+
[1m[36m (0.3ms)[0m [1mROLLBACK[0m
|
906
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.3ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
907
|
+
[1m[35m (0.2ms)[0m BEGIN
|
908
|
+
---------------------------
|
909
|
+
AttributeTest: test_methods
|
910
|
+
---------------------------
|
911
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.3ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
912
|
+
[1m[35m (0.2ms)[0m BEGIN
|
913
|
+
---------------------------
|
914
|
+
AttributeTest: test_methods
|
915
|
+
---------------------------
|
916
|
+
[1m[36m (0.1ms)[0m [1mROLLBACK[0m
|
917
|
+
[1m[35m (0.1ms)[0m BEGIN
|
918
|
+
-----------------------------
|
919
|
+
AssociationTest: test_methods
|
920
|
+
-----------------------------
|
921
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
922
|
+
[1m[35mSQL (0.3ms)[0m INSERT INTO "shops" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2016-10-17 04:26:03.537981"], ["updated_at", "2016-10-17 04:26:03.537981"]]
|
923
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
924
|
+
[1m[35m (0.2ms)[0m SAVEPOINT active_record_1
|
925
|
+
[1m[36mSQL (0.3ms)[0m [1mINSERT INTO "products" ("name", "shop_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["name", "iPhone"], ["shop_id", 11], ["created_at", "2016-10-17 04:26:03.548547"], ["updated_at", "2016-10-17 04:26:03.548547"]]
|
926
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
927
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
928
|
+
[1m[35mSQL (0.2ms)[0m INSERT INTO "products" ("name", "shop_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "iPad"], ["shop_id", 11], ["created_at", "2016-10-17 04:26:03.550397"], ["updated_at", "2016-10-17 04:26:03.550397"]]
|
929
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
930
|
+
[1m[35mProduct Load (0.2ms)[0m SELECT "products".* FROM "products" WHERE "products"."shop_id" = $1 [["shop_id", 11]]
|
931
|
+
[1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m
|
932
|
+
[1m[35mSQL (0.2ms)[0m INSERT INTO "products" ("name", "shop_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "iMac"], ["shop_id", 11], ["created_at", "2016-10-17 04:26:03.554091"], ["updated_at", "2016-10-17 04:26:03.554091"]]
|
933
|
+
[1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
934
|
+
[1m[35m (0.2ms)[0m ROLLBACK
|
data/test/test_helper.rb
CHANGED
@@ -12,10 +12,3 @@ Minitest.backtrace_filter = Minitest::BacktraceFilter.new
|
|
12
12
|
|
13
13
|
# Load support files
|
14
14
|
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
|
15
|
-
|
16
|
-
# Load fixtures from the engine
|
17
|
-
if ActiveSupport::TestCase.respond_to?(:fixture_path=)
|
18
|
-
ActiveSupport::TestCase.fixture_path = File.expand_path('../fixtures', __FILE__)
|
19
|
-
ActionDispatch::IntegrationTest.fixture_path = ActiveSupport::TestCase.fixture_path
|
20
|
-
ActiveSupport::TestCase.fixtures :all
|
21
|
-
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: listable_collections
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- mmontossi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-10-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -16,7 +16,7 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 4.
|
19
|
+
version: 4.2.0
|
20
20
|
- - "<"
|
21
21
|
- !ruby/object:Gem::Version
|
22
22
|
version: 4.3.0
|
@@ -26,7 +26,7 @@ dependencies:
|
|
26
26
|
requirements:
|
27
27
|
- - ">="
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version: 4.
|
29
|
+
version: 4.2.0
|
30
30
|
- - "<"
|
31
31
|
- !ruby/object:Gem::Version
|
32
32
|
version: 4.3.0
|
@@ -75,7 +75,6 @@ files:
|
|
75
75
|
- lib/listable_collections/version.rb
|
76
76
|
- test/association_test.rb
|
77
77
|
- test/attribute_test.rb
|
78
|
-
- test/dummy/README.rdoc
|
79
78
|
- test/dummy/Rakefile
|
80
79
|
- test/dummy/app/assets/javascripts/application.js
|
81
80
|
- test/dummy/app/assets/stylesheets/application.css
|
@@ -117,8 +116,6 @@ files:
|
|
117
116
|
- test/dummy/public/422.html
|
118
117
|
- test/dummy/public/500.html
|
119
118
|
- test/dummy/public/favicon.ico
|
120
|
-
- test/fixtures/products.yml
|
121
|
-
- test/fixtures/shops.yml
|
122
119
|
- test/test_helper.rb
|
123
120
|
homepage: https://github.com/mmontossi/listable_collections
|
124
121
|
licenses:
|
@@ -188,7 +185,4 @@ test_files:
|
|
188
185
|
- test/dummy/public/500.html
|
189
186
|
- test/dummy/public/favicon.ico
|
190
187
|
- test/dummy/Rakefile
|
191
|
-
- test/dummy/README.rdoc
|
192
|
-
- test/fixtures/products.yml
|
193
|
-
- test/fixtures/shops.yml
|
194
188
|
- test/test_helper.rb
|
data/test/dummy/README.rdoc
DELETED
@@ -1,28 +0,0 @@
|
|
1
|
-
== README
|
2
|
-
|
3
|
-
This README would normally document whatever steps are necessary to get the
|
4
|
-
application up and running.
|
5
|
-
|
6
|
-
Things you may want to cover:
|
7
|
-
|
8
|
-
* Ruby version
|
9
|
-
|
10
|
-
* System dependencies
|
11
|
-
|
12
|
-
* Configuration
|
13
|
-
|
14
|
-
* Database creation
|
15
|
-
|
16
|
-
* Database initialization
|
17
|
-
|
18
|
-
* How to run the test suite
|
19
|
-
|
20
|
-
* Services (job queues, cache servers, search engines, etc.)
|
21
|
-
|
22
|
-
* Deployment instructions
|
23
|
-
|
24
|
-
* ...
|
25
|
-
|
26
|
-
|
27
|
-
Please feel free to use a different markup language if you do not plan to run
|
28
|
-
<tt>rake doc:app</tt>.
|
data/test/fixtures/products.yml
DELETED
data/test/fixtures/shops.yml
DELETED