tenacity 0.4.1 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -0
- data/EXTEND.rdoc +18 -21
- data/Gemfile +0 -2
- data/README.rdoc +3 -1
- data/Rakefile +7 -0
- data/history.txt +17 -0
- data/lib/tenacity.rb +4 -0
- data/lib/tenacity/associates_proxy.rb +5 -7
- data/lib/tenacity/association.rb +9 -47
- data/lib/tenacity/associations/belongs_to.rb +1 -2
- data/lib/tenacity/associations/has_many.rb +27 -21
- data/lib/tenacity/associations/has_one.rb +3 -2
- data/lib/tenacity/class_methods.rb +14 -60
- data/lib/tenacity/errors.rb +8 -0
- data/lib/tenacity/instance_methods.rb +42 -12
- data/lib/tenacity/orm_ext/activerecord.rb +11 -32
- data/lib/tenacity/orm_ext/couchrest.rb +14 -22
- data/lib/tenacity/orm_ext/datamapper.rb +14 -31
- data/lib/tenacity/orm_ext/helpers.rb +3 -3
- data/lib/tenacity/orm_ext/mongo_mapper.rb +16 -22
- data/lib/tenacity/orm_ext/mongoid.rb +10 -18
- data/lib/tenacity/orm_ext/ripple.rb +270 -0
- data/lib/tenacity/orm_ext/sequel.rb +21 -33
- data/lib/tenacity/orm_ext/toystore.rb +114 -0
- data/lib/tenacity/version.rb +1 -1
- data/tenacity.gemspec +10 -3
- data/test/association_features/belongs_to_test.rb +12 -0
- data/test/association_features/has_many_test.rb +32 -2
- data/test/association_features/has_one_test.rb +18 -4
- data/test/associations/has_one_test.rb +0 -1
- data/test/core/classmethods_test.rb +7 -0
- data/test/fixtures/active_record_has_many_target.rb +4 -0
- data/test/fixtures/active_record_has_one_target.rb +4 -0
- data/test/fixtures/active_record_object.rb +8 -0
- data/test/fixtures/couch_rest_has_many_target.rb +4 -0
- data/test/fixtures/couch_rest_has_one_target.rb +4 -0
- data/test/fixtures/couch_rest_object.rb +8 -0
- data/test/fixtures/data_mapper_has_many_target.rb +10 -0
- data/test/fixtures/data_mapper_has_one_target.rb +10 -0
- data/test/fixtures/data_mapper_object.rb +8 -0
- data/test/fixtures/mongo_mapper_has_many_target.rb +4 -0
- data/test/fixtures/mongo_mapper_has_one_target.rb +4 -0
- data/test/fixtures/mongo_mapper_object.rb +8 -0
- data/test/fixtures/mongoid_has_many_target.rb +4 -0
- data/test/fixtures/mongoid_has_one_target.rb +4 -0
- data/test/fixtures/mongoid_object.rb +8 -0
- data/test/fixtures/no_associations.rb +4 -0
- data/test/fixtures/ripple_has_many_target.rb +24 -0
- data/test/fixtures/ripple_has_one_target.rb +24 -0
- data/test/fixtures/ripple_object.rb +42 -0
- data/test/fixtures/sequel_has_many_target.rb +4 -0
- data/test/fixtures/sequel_has_one_target.rb +4 -0
- data/test/fixtures/sequel_object.rb +8 -0
- data/test/fixtures/toystore_has_many_target.rb +28 -0
- data/test/fixtures/toystore_has_one_target.rb +28 -0
- data/test/fixtures/toystore_object.rb +46 -0
- data/test/helpers/active_record_test_helper.rb +12 -95
- data/test/helpers/data_mapper_test_helper.rb +0 -64
- data/test/helpers/ripple_test_helper.rb +19 -0
- data/test/helpers/sequel_test_helper.rb +13 -60
- data/test/helpers/toystore_test_helper.rb +17 -0
- data/test/orm_ext/activerecord_test.rb +16 -26
- data/test/orm_ext/couchrest_test.rb +10 -29
- data/test/orm_ext/datamapper_test.rb +16 -29
- data/test/orm_ext/mongo_mapper_test.rb +11 -29
- data/test/orm_ext/mongoid_test.rb +11 -29
- data/test/orm_ext/ripple_test.rb +140 -0
- data/test/orm_ext/sequel_test.rb +15 -26
- data/test/orm_ext/toystore_test.rb +103 -0
- data/test/test_helper.rb +35 -23
- metadata +99 -133
@@ -6,26 +6,34 @@ class SequelObject < Sequel::Model
|
|
6
6
|
t_has_one :data_mapper_has_one_target
|
7
7
|
t_has_one :mongo_mapper_has_one_target
|
8
8
|
require_mongoid { t_has_one :mongoid_has_one_target }
|
9
|
+
require_ripple { t_has_one :ripple_has_one_target }
|
9
10
|
t_has_one :sequel_has_one_target
|
11
|
+
require_toystore { t_has_one :toystore_has_one_target }
|
10
12
|
|
11
13
|
t_has_many :active_record_has_many_targets
|
12
14
|
t_has_many :couch_rest_has_many_targets
|
13
15
|
t_has_many :data_mapper_has_many_targets
|
14
16
|
t_has_many :mongo_mapper_has_many_targets
|
15
17
|
require_mongoid { t_has_many :mongoid_has_many_targets }
|
18
|
+
require_ripple { t_has_many :ripple_has_many_targets }
|
16
19
|
t_has_many :sequel_has_many_targets
|
20
|
+
require_toystore { t_has_many :toystore_has_many_targets }
|
17
21
|
|
18
22
|
t_has_one :active_record_has_one_target, :as => :active_record_has_one_target_testable
|
19
23
|
t_has_one :couch_rest_has_one_target, :as => :couch_rest_has_one_target_testable
|
20
24
|
t_has_one :data_mapper_has_one_target, :as => :data_mapper_has_one_target_testable
|
21
25
|
t_has_one :mongo_mapper_has_one_target, :as => :mongo_mapper_has_one_target_testable
|
22
26
|
require_mongoid { t_has_one :mongoid_has_one_target, :as => :mongoid_has_one_target_testable }
|
27
|
+
require_ripple { t_has_one :ripple_has_one_target, :as => :ripple_has_one_target_testable }
|
23
28
|
t_has_one :sequel_has_one_target, :as => :sequel_has_one_target_testable
|
29
|
+
require_toystore { t_has_one :toystore_has_one_target, :as => :toystore_has_one_target_testable }
|
24
30
|
|
25
31
|
t_has_many :active_record_has_many_targets, :as => :active_record_has_many_target_testable
|
26
32
|
t_has_many :couch_rest_has_many_targets, :as => :couch_rest_has_many_target_testable
|
27
33
|
t_has_many :data_mapper_has_many_targets, :as => :data_mapper_has_many_target_testable
|
28
34
|
t_has_many :mongo_mapper_has_many_targets, :as => :mongo_mapper_has_many_target_testable
|
29
35
|
require_mongoid { t_has_many :mongoid_has_many_targets, :as => :mongoid_has_many_target_testable }
|
36
|
+
require_ripple { t_has_many :ripple_has_many_targets, :as => :ripple_has_many_target_testable }
|
30
37
|
t_has_many :sequel_has_many_targets, :as => :sequel_has_many_target_testable
|
38
|
+
require_toystore { t_has_many :toystore_has_many_targets, :as => :toystore_has_many_target_testable }
|
31
39
|
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
require_toystore do
|
2
|
+
require 'adapter/mongo'
|
3
|
+
|
4
|
+
class ToystoreHasManyTarget
|
5
|
+
include Toy::Store
|
6
|
+
store :mongo, Mongo::Connection.new.db('tenacity_test')['toystore']
|
7
|
+
|
8
|
+
include Tenacity
|
9
|
+
|
10
|
+
t_belongs_to :active_record_object
|
11
|
+
t_belongs_to :couch_rest_object
|
12
|
+
t_belongs_to :data_mapper_object
|
13
|
+
t_belongs_to :mongo_mapper_object
|
14
|
+
t_belongs_to :mongoid_object
|
15
|
+
t_belongs_to :ripple_object
|
16
|
+
t_belongs_to :sequel_object
|
17
|
+
t_belongs_to :toystore_object
|
18
|
+
|
19
|
+
t_belongs_to :active_record_has_many_target_testable, :polymorphic => true
|
20
|
+
t_belongs_to :couch_rest_has_many_target_testable, :polymorphic => true
|
21
|
+
t_belongs_to :data_mapper_has_many_target_testable, :polymorphic => true
|
22
|
+
t_belongs_to :mongo_mapper_has_many_target_testable, :polymorphic => true
|
23
|
+
require_mongoid { t_belongs_to :mongoid_has_many_target_testable, :polymorphic => true }
|
24
|
+
require_ripple { t_belongs_to :ripple_has_many_target_testable, :polymorphic => true }
|
25
|
+
t_belongs_to :sequel_has_many_target_testable, :polymorphic => true
|
26
|
+
require_toystore { t_belongs_to :toystore_has_many_target_testable, :polymorphic => true }
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
require_toystore do
|
2
|
+
require 'adapter/mongo'
|
3
|
+
|
4
|
+
class ToystoreHasOneTarget
|
5
|
+
include Toy::Store
|
6
|
+
store :mongo, Mongo::Connection.new.db('tenacity_test')['toystore']
|
7
|
+
|
8
|
+
include Tenacity
|
9
|
+
|
10
|
+
t_belongs_to :active_record_object
|
11
|
+
t_belongs_to :couch_rest_object
|
12
|
+
t_belongs_to :data_mapper_object
|
13
|
+
t_belongs_to :mongo_mapper_object
|
14
|
+
t_belongs_to :mongoid_object
|
15
|
+
t_belongs_to :ripple_object
|
16
|
+
t_belongs_to :sequel_object
|
17
|
+
t_belongs_to :toystore_object
|
18
|
+
|
19
|
+
t_belongs_to :active_record_has_one_target_testable, :polymorphic => true
|
20
|
+
t_belongs_to :couch_rest_has_one_target_testable, :polymorphic => true
|
21
|
+
t_belongs_to :data_mapper_has_one_target_testable, :polymorphic => true
|
22
|
+
t_belongs_to :mongo_mapper_has_one_target_testable, :polymorphic => true
|
23
|
+
require_mongoid { t_belongs_to :mongoid_has_one_target_testable, :polymorphic => true }
|
24
|
+
require_ripple { t_belongs_to :ripple_has_one_target_testable, :polymorphic => true }
|
25
|
+
t_belongs_to :sequel_has_one_target_testable, :polymorphic => true
|
26
|
+
require_toystore { t_belongs_to :toystore_has_one_target_testable, :polymorphic => true }
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,46 @@
|
|
1
|
+
require_toystore do
|
2
|
+
require 'adapter/mongo'
|
3
|
+
|
4
|
+
class ToystoreObject
|
5
|
+
include Toy::Store
|
6
|
+
store :mongo, Mongo::Connection.new.db('tenacity_test')['toystore']
|
7
|
+
|
8
|
+
include Tenacity
|
9
|
+
|
10
|
+
t_has_one :active_record_has_one_target
|
11
|
+
t_has_one :couch_rest_has_one_target
|
12
|
+
t_has_one :data_mapper_has_one_target
|
13
|
+
t_has_one :mongo_mapper_has_one_target
|
14
|
+
t_has_one :mongoid_has_one_target
|
15
|
+
t_has_one :ripple_has_one_target
|
16
|
+
t_has_one :sequel_has_one_target
|
17
|
+
t_has_one :toystore_has_one_target
|
18
|
+
|
19
|
+
t_has_many :active_record_has_many_targets
|
20
|
+
t_has_many :couch_rest_has_many_targets
|
21
|
+
t_has_many :data_mapper_has_many_targets
|
22
|
+
t_has_many :mongo_mapper_has_many_targets
|
23
|
+
t_has_many :mongoid_has_many_targets
|
24
|
+
t_has_many :ripple_has_many_targets
|
25
|
+
t_has_many :sequel_has_many_targets
|
26
|
+
t_has_many :toystore_has_many_targets
|
27
|
+
|
28
|
+
t_has_one :active_record_has_one_target, :as => :active_record_has_one_target_testable
|
29
|
+
t_has_one :couch_rest_has_one_target, :as => :couch_rest_has_one_target_testable
|
30
|
+
t_has_one :data_mapper_has_one_target, :as => :data_mapper_has_one_target_testable
|
31
|
+
t_has_one :mongo_mapper_has_one_target, :as => :mongo_mapper_has_one_target_testable
|
32
|
+
require_mongoid { t_has_one :mongoid_has_one_target, :as => :mongoid_has_one_target_testable }
|
33
|
+
require_ripple { t_has_one :ripple_has_one_target, :as => :ripple_has_one_target_testable }
|
34
|
+
t_has_one :sequel_has_one_target, :as => :sequel_has_one_target_testable
|
35
|
+
require_toystore { t_has_one :toystore_has_one_target, :as => :toystore_has_one_target_testable }
|
36
|
+
|
37
|
+
t_has_many :active_record_has_many_targets, :as => :active_record_has_many_target_testable
|
38
|
+
t_has_many :couch_rest_has_many_targets, :as => :couch_rest_has_many_target_testable
|
39
|
+
t_has_many :data_mapper_has_many_targets, :as => :data_mapper_has_many_target_testable
|
40
|
+
t_has_many :mongo_mapper_has_many_targets, :as => :mongo_mapper_has_many_target_testable
|
41
|
+
require_mongoid { t_has_many :mongoid_has_many_targets, :as => :mongoid_has_many_target_testable }
|
42
|
+
require_ripple { t_has_many :ripple_has_many_targets, :as => :ripple_has_many_target_testable }
|
43
|
+
t_has_many :sequel_has_many_targets, :as => :sequel_has_many_target_testable
|
44
|
+
require_toystore { t_has_many :toystore_has_many_targets, :as => :toystore_has_many_target_testable }
|
45
|
+
end
|
46
|
+
end
|
@@ -17,35 +17,10 @@ ActiveRecord::Schema.define :version => 0 do
|
|
17
17
|
t.string :mongo_mapper_dashboard_id
|
18
18
|
end
|
19
19
|
|
20
|
-
create_table :active_record_cars_mongo_mapper_wheels, :force => true do |t|
|
21
|
-
t.integer :active_record_car_id
|
22
|
-
t.string :mongo_mapper_wheel_id
|
23
|
-
end
|
24
|
-
|
25
|
-
create_table :active_record_engines_diagnosables, :force => true do |t|
|
26
|
-
t.integer :active_record_engine_id
|
27
|
-
t.string :diagnosable_id
|
28
|
-
end
|
29
|
-
|
30
|
-
create_table :active_record_cars_mongo_mapper_windows, :force => true do |t|
|
31
|
-
t.integer :active_record_car_id
|
32
|
-
t.string :mongo_mapper_window_id
|
33
|
-
end
|
34
|
-
|
35
|
-
create_table :active_record_cars_couch_rest_doors, :force => true do |t|
|
36
|
-
t.integer :active_record_car_id
|
37
|
-
t.string :couch_rest_door_id
|
38
|
-
end
|
39
|
-
|
40
20
|
create_table :active_record_nuts, :force => true do |t|
|
41
21
|
t.string :mongo_mapper_wheel_id
|
42
22
|
end
|
43
23
|
|
44
|
-
create_table :nuts_and_wheels, :force => true do |t|
|
45
|
-
t.integer :nut_id
|
46
|
-
t.string :mongo_mapper_wheel_id
|
47
|
-
end
|
48
|
-
|
49
24
|
create_table :active_record_objects, :force => true do |t|
|
50
25
|
t.string :prop
|
51
26
|
end
|
@@ -56,7 +31,9 @@ ActiveRecord::Schema.define :version => 0 do
|
|
56
31
|
t.integer :data_mapper_object_id
|
57
32
|
t.string :mongo_mapper_object_id
|
58
33
|
t.string :mongoid_object_id
|
34
|
+
t.string :ripple_object_id
|
59
35
|
t.integer :sequel_object_id
|
36
|
+
t.string :toystore_object_id
|
60
37
|
|
61
38
|
t.string :active_record_has_one_target_testable_id
|
62
39
|
t.string :active_record_has_one_target_testable_type
|
@@ -68,8 +45,12 @@ ActiveRecord::Schema.define :version => 0 do
|
|
68
45
|
t.string :mongo_mapper_has_one_target_testable_type
|
69
46
|
t.string :mongoid_has_one_target_testable_id
|
70
47
|
t.string :mongoid_has_one_target_testable_type
|
48
|
+
t.string :ripple_has_one_target_testable_id
|
49
|
+
t.string :ripple_has_one_target_testable_type
|
71
50
|
t.string :sequel_has_one_target_testable_id
|
72
51
|
t.string :sequel_has_one_target_testable_type
|
52
|
+
t.string :toystore_has_one_target_testable_id
|
53
|
+
t.string :toystore_has_one_target_testable_type
|
73
54
|
end
|
74
55
|
|
75
56
|
create_table :active_record_has_many_targets, :force => true do |t|
|
@@ -78,7 +59,9 @@ ActiveRecord::Schema.define :version => 0 do
|
|
78
59
|
t.integer :data_mapper_object_id
|
79
60
|
t.string :mongo_mapper_object_id
|
80
61
|
t.string :mongoid_object_id
|
62
|
+
t.string :ripple_object_id
|
81
63
|
t.integer :sequel_object_id
|
64
|
+
t.string :toystore_object_id
|
82
65
|
|
83
66
|
t.string :active_record_has_many_target_testable_id
|
84
67
|
t.string :active_record_has_many_target_testable_type
|
@@ -90,78 +73,12 @@ ActiveRecord::Schema.define :version => 0 do
|
|
90
73
|
t.string :mongo_mapper_has_many_target_testable_type
|
91
74
|
t.string :mongoid_has_many_target_testable_id
|
92
75
|
t.string :mongoid_has_many_target_testable_type
|
76
|
+
t.string :ripple_has_many_target_testable_id
|
77
|
+
t.string :ripple_has_many_target_testable_type
|
93
78
|
t.string :sequel_has_many_target_testable_id
|
94
79
|
t.string :sequel_has_many_target_testable_type
|
95
|
-
|
96
|
-
|
97
|
-
create_table :active_record_has_many_targets_active_record_objects, :force => true do |t|
|
98
|
-
t.integer :active_record_object_id
|
99
|
-
t.integer :active_record_has_many_target_id
|
100
|
-
end
|
101
|
-
|
102
|
-
create_table :active_record_objects_mongo_mapper_has_many_targets, :force => true do |t|
|
103
|
-
t.integer :active_record_object_id
|
104
|
-
t.string :mongo_mapper_has_many_target_id
|
105
|
-
end
|
106
|
-
|
107
|
-
create_table :active_record_objects_couch_rest_has_many_targets, :force => true do |t|
|
108
|
-
t.integer :active_record_object_id
|
109
|
-
t.string :couch_rest_has_many_target_id
|
110
|
-
end
|
111
|
-
|
112
|
-
create_table :active_record_objects_data_mapper_has_many_targets, :force => true do |t|
|
113
|
-
t.integer :active_record_object_id
|
114
|
-
t.integer :data_mapper_has_many_target_id
|
115
|
-
end
|
116
|
-
|
117
|
-
create_table :active_record_objects_mongoid_has_many_targets, :force => true do |t|
|
118
|
-
t.integer :active_record_object_id
|
119
|
-
t.string :mongoid_has_many_target_id
|
120
|
-
end
|
121
|
-
|
122
|
-
create_table :active_record_objects_sequel_has_many_targets, :force => true do |t|
|
123
|
-
t.integer :active_record_object_id
|
124
|
-
t.integer :sequel_has_many_target_id
|
125
|
-
end
|
126
|
-
|
127
|
-
create_table :active_record_objects_mongo_mapper_autosave_true_has_many_targets, :force => true do |t|
|
128
|
-
t.integer :active_record_object_id
|
129
|
-
t.integer :mongo_mapper_autosave_true_has_many_target_id
|
130
|
-
end
|
131
|
-
|
132
|
-
create_table :active_record_objects_mongo_mapper_autosave_false_has_many_targets, :force => true do |t|
|
133
|
-
t.integer :active_record_object_id
|
134
|
-
t.integer :mongo_mapper_autosave_false_has_many_target_id
|
135
|
-
end
|
136
|
-
|
137
|
-
create_table :active_record_has_many_target_testables_active_record_objects, :force => true do |t|
|
138
|
-
t.integer :active_record_object_id
|
139
|
-
t.integer :active_record_has_many_target_testable_id
|
140
|
-
end
|
141
|
-
|
142
|
-
create_table :active_record_objects_mongo_mapper_has_many_target_testables, :force => true do |t|
|
143
|
-
t.integer :active_record_object_id
|
144
|
-
t.string :mongo_mapper_has_many_target_testable_id
|
145
|
-
end
|
146
|
-
|
147
|
-
create_table :active_record_objects_data_mapper_has_many_target_testables, :force => true do |t|
|
148
|
-
t.integer :active_record_object_id
|
149
|
-
t.string :data_mapper_has_many_target_testable_id
|
150
|
-
end
|
151
|
-
|
152
|
-
create_table :active_record_objects_couch_rest_has_many_target_testables, :force => true do |t|
|
153
|
-
t.integer :active_record_object_id
|
154
|
-
t.string :couch_rest_has_many_target_testable_id
|
155
|
-
end
|
156
|
-
|
157
|
-
create_table :active_record_objects_sequel_has_many_target_testables, :force => true do |t|
|
158
|
-
t.integer :active_record_object_id
|
159
|
-
t.string :sequel_has_many_target_testable_id
|
160
|
-
end
|
161
|
-
|
162
|
-
create_table :active_record_objects_mongoid_has_many_target_testables, :force => true do |t|
|
163
|
-
t.integer :active_record_object_id
|
164
|
-
t.string :mongoid_has_many_target_testable_id
|
80
|
+
t.string :toystore_has_many_target_testable_id
|
81
|
+
t.string :toystore_has_many_target_testable_type
|
165
82
|
end
|
166
83
|
|
167
84
|
end
|
@@ -6,70 +6,6 @@ DataMapper.setup(:default, {
|
|
6
6
|
:adapter => 'sqlite3',
|
7
7
|
:database => ':memory:'})
|
8
8
|
|
9
|
-
migration 1, :create_join_tables do
|
10
|
-
up do
|
11
|
-
create_table :active_record_has_many_targets_data_mapper_objects do
|
12
|
-
column :data_mapper_object_id, Integer
|
13
|
-
column :active_record_has_many_target_id, Integer
|
14
|
-
end
|
15
|
-
|
16
|
-
create_table :data_mapper_objects_mongo_mapper_has_many_targets do
|
17
|
-
column :data_mapper_object_id, Integer
|
18
|
-
column :mongo_mapper_has_many_target_id, String
|
19
|
-
end
|
20
|
-
|
21
|
-
create_table :couch_rest_has_many_targets_data_mapper_objects do
|
22
|
-
column :data_mapper_object_id, Integer
|
23
|
-
column :couch_rest_has_many_target_id, String
|
24
|
-
end
|
25
|
-
|
26
|
-
create_table :data_mapper_has_many_targets_data_mapper_objects do
|
27
|
-
column :data_mapper_object_id, Integer
|
28
|
-
column :data_mapper_has_many_target_id, Integer
|
29
|
-
end
|
30
|
-
|
31
|
-
create_table :data_mapper_objects_mongoid_has_many_targets do
|
32
|
-
column :data_mapper_object_id, Integer
|
33
|
-
column :mongoid_has_many_target_id, String
|
34
|
-
end
|
35
|
-
|
36
|
-
create_table :data_mapper_objects_sequel_has_many_targets do
|
37
|
-
column :data_mapper_object_id, Integer
|
38
|
-
column :sequel_has_many_target_id, Integer
|
39
|
-
end
|
40
|
-
|
41
|
-
create_table :active_record_has_many_target_testables_data_mapper_objects do
|
42
|
-
column :data_mapper_object_id, Integer
|
43
|
-
column :active_record_has_many_target_testable_id, Integer
|
44
|
-
end
|
45
|
-
|
46
|
-
create_table :data_mapper_objects_mongo_mapper_has_many_target_testables do
|
47
|
-
column :data_mapper_object_id, Integer
|
48
|
-
column :mongo_mapper_has_many_target_testable_id, String
|
49
|
-
end
|
50
|
-
|
51
|
-
create_table :couch_rest_has_many_target_testables_data_mapper_objects do
|
52
|
-
column :data_mapper_object_id, Integer
|
53
|
-
column :couch_rest_has_many_target_testable_id, String
|
54
|
-
end
|
55
|
-
|
56
|
-
create_table :data_mapper_has_many_target_testables_data_mapper_objects do
|
57
|
-
column :data_mapper_object_id, Integer
|
58
|
-
column :data_mapper_has_many_target_testable_id, Integer
|
59
|
-
end
|
60
|
-
|
61
|
-
create_table :data_mapper_objects_mongoid_has_many_target_testables do
|
62
|
-
column :data_mapper_object_id, Integer
|
63
|
-
column :mongoid_has_many_target_testable_id, String
|
64
|
-
end
|
65
|
-
|
66
|
-
create_table :data_mapper_objects_sequel_has_many_target_testables do
|
67
|
-
column :data_mapper_object_id, Integer
|
68
|
-
column :sequel_has_many_target_testable_id, Integer
|
69
|
-
end
|
70
|
-
end
|
71
|
-
end
|
72
|
-
|
73
9
|
migrate_up!
|
74
10
|
|
75
11
|
def migrate_data_mapper_tables
|
@@ -0,0 +1,19 @@
|
|
1
|
+
def require_ripple
|
2
|
+
begin
|
3
|
+
require 'ripple'
|
4
|
+
yield
|
5
|
+
rescue LoadError
|
6
|
+
end
|
7
|
+
end
|
8
|
+
|
9
|
+
begin
|
10
|
+
require 'ripple'
|
11
|
+
|
12
|
+
unless Ripple.client.ping
|
13
|
+
puts "Riak is not running, and is required. Please start it."
|
14
|
+
exit
|
15
|
+
end
|
16
|
+
rescue LoadError
|
17
|
+
puts "WARNING: Ripple could not be loaded. Skipping tests."
|
18
|
+
end
|
19
|
+
|
@@ -1,6 +1,7 @@
|
|
1
1
|
require 'sequel'
|
2
2
|
|
3
3
|
DB = Sequel.sqlite
|
4
|
+
Sequel::Model.raise_on_save_failure = true
|
4
5
|
|
5
6
|
DB.create_table :sequel_objects do
|
6
7
|
primary_key :id
|
@@ -14,7 +15,9 @@ DB.create_table :sequel_has_one_targets do
|
|
14
15
|
Integer :data_mapper_object_id
|
15
16
|
String :mongo_mapper_object_id
|
16
17
|
String :mongoid_object_id
|
18
|
+
String :ripple_object_id
|
17
19
|
Integer :sequel_object_id
|
20
|
+
String :toystore_object_id
|
18
21
|
|
19
22
|
String :active_record_has_one_target_testable_id
|
20
23
|
String :active_record_has_one_target_testable_type
|
@@ -26,8 +29,12 @@ DB.create_table :sequel_has_one_targets do
|
|
26
29
|
String :mongo_mapper_has_one_target_testable_type
|
27
30
|
String :mongoid_has_one_target_testable_id
|
28
31
|
String :mongoid_has_one_target_testable_type
|
32
|
+
String :ripple_has_one_target_testable_id
|
33
|
+
String :ripple_has_one_target_testable_type
|
29
34
|
String :sequel_has_one_target_testable_id
|
30
35
|
String :sequel_has_one_target_testable_type
|
36
|
+
String :toystore_has_one_target_testable_id
|
37
|
+
String :toystore_has_one_target_testable_type
|
31
38
|
end
|
32
39
|
|
33
40
|
DB.create_table :sequel_has_many_targets do
|
@@ -38,7 +45,9 @@ DB.create_table :sequel_has_many_targets do
|
|
38
45
|
Integer :data_mapper_object_id
|
39
46
|
String :mongo_mapper_object_id
|
40
47
|
String :mongoid_object_id
|
48
|
+
String :ripple_object_id
|
41
49
|
Integer :sequel_object_id
|
50
|
+
String :toystore_object_id
|
42
51
|
|
43
52
|
String :active_record_has_many_target_testable_id
|
44
53
|
String :active_record_has_many_target_testable_type
|
@@ -50,67 +59,11 @@ DB.create_table :sequel_has_many_targets do
|
|
50
59
|
String :mongo_mapper_has_many_target_testable_type
|
51
60
|
String :mongoid_has_many_target_testable_id
|
52
61
|
String :mongoid_has_many_target_testable_type
|
62
|
+
String :ripple_has_many_target_testable_id
|
63
|
+
String :ripple_has_many_target_testable_type
|
53
64
|
String :sequel_has_many_target_testable_id
|
54
65
|
String :sequel_has_many_target_testable_type
|
55
|
-
|
56
|
-
|
57
|
-
DB.create_table :active_record_has_many_targets_sequel_objects do
|
58
|
-
Integer :sequel_object_id
|
59
|
-
Integer :active_record_has_many_target_id
|
60
|
-
end
|
61
|
-
|
62
|
-
DB.create_table :mongo_mapper_has_many_targets_sequel_objects do
|
63
|
-
Integer :sequel_object_id
|
64
|
-
String :mongo_mapper_has_many_target_id
|
65
|
-
end
|
66
|
-
|
67
|
-
DB.create_table :couch_rest_has_many_targets_sequel_objects do
|
68
|
-
Integer :sequel_object_id
|
69
|
-
String :couch_rest_has_many_target_id
|
70
|
-
end
|
71
|
-
|
72
|
-
DB.create_table :data_mapper_has_many_targets_sequel_objects do
|
73
|
-
Integer :sequel_object_id
|
74
|
-
Integer :data_mapper_has_many_target_id
|
75
|
-
end
|
76
|
-
|
77
|
-
DB.create_table :mongoid_has_many_targets_sequel_objects do
|
78
|
-
Integer :sequel_object_id
|
79
|
-
String :mongoid_has_many_target_id
|
80
|
-
end
|
81
|
-
|
82
|
-
DB.create_table :sequel_has_many_targets_sequel_objects do
|
83
|
-
Integer :sequel_object_id
|
84
|
-
Integer :sequel_has_many_target_id
|
85
|
-
end
|
86
|
-
|
87
|
-
DB.create_table :active_record_has_many_target_testables_sequel_objects do
|
88
|
-
Integer :sequel_object_id
|
89
|
-
Integer :active_record_has_many_target_testable_id
|
90
|
-
end
|
91
|
-
|
92
|
-
DB.create_table :mongo_mapper_has_many_target_testables_sequel_objects do
|
93
|
-
Integer :sequel_object_id
|
94
|
-
String :mongo_mapper_has_many_target_testable_id
|
95
|
-
end
|
96
|
-
|
97
|
-
DB.create_table :couch_rest_has_many_target_testables_sequel_objects do
|
98
|
-
Integer :sequel_object_id
|
99
|
-
String :couch_rest_has_many_target_testable_id
|
100
|
-
end
|
101
|
-
|
102
|
-
DB.create_table :data_mapper_has_many_target_testables_sequel_objects do
|
103
|
-
Integer :sequel_object_id
|
104
|
-
Integer :data_mapper_has_many_target_testable_id
|
105
|
-
end
|
106
|
-
|
107
|
-
DB.create_table :mongoid_has_many_target_testables_sequel_objects do
|
108
|
-
Integer :sequel_object_id
|
109
|
-
String :mongoid_has_many_target_testable_id
|
110
|
-
end
|
111
|
-
|
112
|
-
DB.create_table :sequel_has_many_target_testables_sequel_objects do
|
113
|
-
Integer :sequel_object_id
|
114
|
-
Integer :sequel_has_many_target_testable_id
|
66
|
+
String :toystore_has_many_target_testable_id
|
67
|
+
String :toystore_has_many_target_testable_type
|
115
68
|
end
|
116
69
|
|