polymorpheus 1.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.md +2 -2
- data/lib/polymorpheus/mysql_adapter.rb +1 -2
- data/lib/polymorpheus/version.rb +1 -1
- data/polymorpheus.gemspec +6 -0
- data/spec/mysql2_adapter_spec.rb +47 -142
- data/spec/shared_examples.rb +115 -0
- metadata +38 -7
data/README.md
CHANGED
@@ -69,8 +69,8 @@ Now let's review what we've done.
|
|
69
69
|
* Instead of `imageable_type` and `imageable_id` columns in the pictures table, we've created explicit columns for the `employee_id` and `product_id`
|
70
70
|
* The `add_polymorphic_constraints` call takes care of all of the database constraints you need, without you needing to worry about sql! Specifically it:
|
71
71
|
* Creates foreign key relationships in the database as specified. So in this example, we have specified that the `employee_id` column in the `pictures` table should have a foreign key constraint with the `id` column of the `employees` table.
|
72
|
-
* Creates appropriate triggers in our database that make sure that exactly on or the other of `employee_id` or `
|
73
|
-
* **Options for migrations**: There are options to
|
72
|
+
* Creates appropriate triggers in our database that make sure that exactly on or the other of `employee_id` or `product_id` are specified for a given record. An exception will be raised if you try to save a database record that contains both or none of them.
|
73
|
+
* **Options for migrations**: There are options to customize the foreign keys generated by Polymorpheus and add uniqueness constraints. For more info on this, [read the wiki entry](https://github.com/wegowise/polymorpheus/wiki/Migration-options).
|
74
74
|
|
75
75
|
## Model definitions
|
76
76
|
|
@@ -55,8 +55,7 @@ module Polymorpheus
|
|
55
55
|
def remove_polymorphic_constraints(table, columns, options = {})
|
56
56
|
poly_drop_triggers(table, columns.keys.sort)
|
57
57
|
columns.each do |(col, reference)|
|
58
|
-
|
59
|
-
remove_foreign_key table, ref_table
|
58
|
+
remove_foreign_key table, :column => col
|
60
59
|
end
|
61
60
|
if options[:unique].present?
|
62
61
|
poly_remove_indexes(table, columns.keys, Array(options[:unique]))
|
data/lib/polymorpheus/version.rb
CHANGED
data/polymorpheus.gemspec
CHANGED
@@ -5,14 +5,20 @@ require File.dirname(__FILE__) + "/lib/polymorpheus/version"
|
|
5
5
|
Gem::Specification.new do |s|
|
6
6
|
s.name = "polymorpheus"
|
7
7
|
s.version = Polymorpheus::VERSION
|
8
|
+
|
8
9
|
s.authors = ["Barun Singh"]
|
9
10
|
s.email = "bsingh@wegowise.com"
|
10
11
|
s.homepage = "http://github.com/wegowise/polymorpheus"
|
11
12
|
s.summary = "Provides a database-friendly method for polymorphic relationships"
|
12
13
|
s.description = "Provides a database-friendly method for polymorphic relationships"
|
14
|
+
|
13
15
|
s.required_rubygems_version = ">= 1.3.6"
|
14
16
|
s.files = Dir.glob(%w[{lib,spec}/**/*.rb [A-Z]*.{txt,rdoc,md} *.gemspec]) + %w{Rakefile}
|
15
17
|
s.extra_rdoc_files = ["README.md", "LICENSE.txt"]
|
16
18
|
s.license = 'MIT'
|
19
|
+
|
17
20
|
s.add_dependency('foreigner')
|
21
|
+
s.add_dependency('activerecord', '>=3.0')
|
22
|
+
s.add_development_dependency('rspec-rails')
|
23
|
+
s.add_development_dependency('mysql2')
|
18
24
|
end
|
data/spec/mysql2_adapter_spec.rb
CHANGED
@@ -5,11 +5,16 @@ require 'foreigner'
|
|
5
5
|
require 'foreigner/connection_adapters/mysql2_adapter'
|
6
6
|
require 'polymorpheus'
|
7
7
|
require 'polymorpheus/trigger'
|
8
|
+
require 'shared_examples'
|
8
9
|
|
9
10
|
Polymorpheus::Adapter.load!
|
10
11
|
|
11
12
|
describe Polymorpheus::ConnectionAdapters::MysqlAdapter do
|
12
13
|
|
14
|
+
#######################################################
|
15
|
+
# Setup
|
16
|
+
#######################################################
|
17
|
+
|
13
18
|
before(:all) do
|
14
19
|
class << ActiveRecord::Base.connection
|
15
20
|
include Polymorpheus::SqlLogger
|
@@ -27,174 +32,80 @@ describe Polymorpheus::ConnectionAdapters::MysqlAdapter do
|
|
27
32
|
let(:connection) { ActiveRecord::Base.connection }
|
28
33
|
let(:sql) { connection.sql_statements }
|
29
34
|
|
35
|
+
def clean_sql(sql_string)
|
36
|
+
sql_string.gsub(/^\n\s*/,'').gsub(/\s*\n\s*$/,'')
|
37
|
+
.gsub(/\n\s*/,"\n").gsub(/\s*$/,"")
|
38
|
+
end
|
39
|
+
|
30
40
|
before do
|
31
41
|
connection.clear_sql_history
|
32
42
|
subject
|
33
43
|
end
|
34
44
|
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
specify do
|
40
|
-
clean_sql(sql.join("\n")).should == clean_sql(full_constraints_sql)
|
41
|
-
end
|
42
|
-
end
|
43
|
-
|
44
|
-
describe "#add_polymorphic_triggers" do
|
45
|
-
before { connection.add_polymorphic_triggers(table, columns.keys) }
|
46
|
-
|
47
|
-
specify do
|
48
|
-
clean_sql(sql.join("\n")).should == clean_sql(trigger_sql)
|
49
|
-
end
|
50
|
-
end
|
51
|
-
end
|
45
|
+
#######################################################
|
46
|
+
# Specs
|
47
|
+
#######################################################
|
52
48
|
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
let(:trigger_sql) do
|
59
|
-
%{
|
60
|
-
DROP TRIGGER IF EXISTS pfki_pets_dogid_kittyid
|
61
|
-
DROP TRIGGER IF EXISTS pfku_pets_dogid_kittyid
|
62
|
-
CREATE TRIGGER pfki_pets_dogid_kittyid BEFORE INSERT ON pets
|
63
|
-
FOR EACH ROW
|
64
|
-
BEGIN
|
65
|
-
IF(IF(NEW.dog_id IS NULL, 0, 1) + IF(NEW.kitty_id IS NULL, 0, 1)) <> 1 THEN
|
66
|
-
SET NEW = 'Error';
|
67
|
-
END IF;
|
68
|
-
END
|
69
|
-
CREATE TRIGGER pfku_pets_dogid_kittyid BEFORE UPDATE ON pets
|
70
|
-
FOR EACH ROW
|
71
|
-
BEGIN
|
72
|
-
IF(IF(NEW.dog_id IS NULL, 0, 1) + IF(NEW.kitty_id IS NULL, 0, 1)) <> 1 THEN
|
73
|
-
SET NEW = 'Error';
|
74
|
-
END IF;
|
75
|
-
END
|
76
|
-
}
|
77
|
-
end
|
49
|
+
describe "migration statements" do
|
50
|
+
context "basic case with no uniqueness constraints" do
|
51
|
+
include_context "columns with short names"
|
52
|
+
let(:options) { {} }
|
78
53
|
|
79
|
-
|
80
|
-
%{
|
81
|
-
ALTER TABLE `pets` ADD CONSTRAINT `pets_dog_id_fk` FOREIGN KEY (`dog_id`) REFERENCES `dogs`(id)
|
82
|
-
ALTER TABLE `pets` ADD CONSTRAINT `pets_kitty_id_fk` FOREIGN KEY (`kitty_id`) REFERENCES `cats`(name)
|
83
|
-
}
|
54
|
+
it_behaves_like "mysql2 migration statements"
|
84
55
|
end
|
85
56
|
|
86
|
-
|
87
|
-
|
88
|
-
it_behaves_like "migration statements"
|
89
|
-
|
90
|
-
context "and we specify a uniqueness constraint as true" do
|
57
|
+
context "when uniqueness constraint is specified as true" do
|
58
|
+
include_context "columns with short names"
|
91
59
|
let(:options) { { :unique => true } }
|
92
60
|
let(:unique_key_sql) do
|
93
|
-
%{
|
94
|
-
|
95
|
-
|
96
|
-
|
61
|
+
%{ CREATE UNIQUE INDEX pfk_pets_dogid ON pets (dog_id)
|
62
|
+
CREATE UNIQUE INDEX pfk_pets_kittyid ON pets (kitty_id) }
|
63
|
+
end
|
64
|
+
let(:remove_indices_sql) do
|
65
|
+
%{ DROP INDEX pfk_pets_kittyid ON pets
|
66
|
+
DROP INDEX pfk_pets_dogid ON pets }
|
97
67
|
end
|
98
68
|
|
99
|
-
|
100
|
-
|
101
|
-
it_behaves_like "migration statements"
|
69
|
+
it_behaves_like "mysql2 migration statements"
|
102
70
|
end
|
103
71
|
|
104
|
-
context "
|
72
|
+
context "specifying uniqueness constraint as a string" do
|
73
|
+
include_context "columns with short names"
|
105
74
|
let(:options) { { :unique => 'field1' } }
|
106
75
|
let(:unique_key_sql) do
|
107
|
-
%{
|
108
|
-
|
109
|
-
|
110
|
-
|
76
|
+
%{ CREATE UNIQUE INDEX pfk_pets_dogid_field1 ON pets (dog_id, field1)
|
77
|
+
CREATE UNIQUE INDEX pfk_pets_kittyid_field1 ON pets (kitty_id, field1) }
|
78
|
+
end
|
79
|
+
let(:remove_indices_sql) do
|
80
|
+
%{ DROP INDEX pfk_pets_kittyid_field1 ON pets
|
81
|
+
DROP INDEX pfk_pets_dogid_field1 ON pets }
|
111
82
|
end
|
112
83
|
|
113
|
-
|
114
|
-
|
115
|
-
it_behaves_like "migration statements"
|
84
|
+
it_behaves_like "mysql2 migration statements"
|
116
85
|
end
|
117
86
|
|
118
|
-
context "
|
87
|
+
context "specifying uniqueness constraint as an array" do
|
88
|
+
include_context "columns with short names"
|
119
89
|
let(:options) { { :unique => [:foo, :bar] } }
|
120
90
|
let(:unique_key_sql) do
|
121
|
-
%{
|
122
|
-
|
123
|
-
CREATE UNIQUE INDEX pfk_pets_kittyid_foo_bar ON pets (kitty_id, foo, bar)
|
124
|
-
}
|
125
|
-
end
|
126
|
-
|
127
|
-
let(:full_constraints_sql) { trigger_sql + unique_key_sql + fkey_sql }
|
128
|
-
|
129
|
-
it_behaves_like "migration statements"
|
130
|
-
end
|
131
|
-
|
132
|
-
context "and we specify a uniqueness constraint on fields with really long names" do
|
133
|
-
let(:options) do
|
134
|
-
{ :unique => [:fee_was_a_buddhist_prodigy, :ground_control_to_major_tom] }
|
91
|
+
%{ CREATE UNIQUE INDEX pfk_pets_dogid_foo_bar ON pets (dog_id, foo, bar)
|
92
|
+
CREATE UNIQUE INDEX pfk_pets_kittyid_foo_bar ON pets (kitty_id, foo, bar) }
|
135
93
|
end
|
136
|
-
let(:
|
137
|
-
%{
|
138
|
-
|
139
|
-
CREATE UNIQUE INDEX pfk_pets_kittyid_feewasabuddhistpr_groundcontroltoma ON pets (kitty_id, fee_was_a_buddhist_prodigy, ground_control_to_major_tom)
|
140
|
-
}
|
94
|
+
let(:remove_indices_sql) do
|
95
|
+
%{ DROP INDEX pfk_pets_kittyid_foo_bar ON pets
|
96
|
+
DROP INDEX pfk_pets_dogid_foo_bar ON pets }
|
141
97
|
end
|
142
98
|
|
143
|
-
|
144
|
-
|
145
|
-
it_behaves_like "migration statements"
|
146
|
-
end
|
147
|
-
end
|
148
|
-
|
149
|
-
context "when the table and column names combined are very long" do
|
150
|
-
let(:table) { 'bicycles' }
|
151
|
-
let(:columns) do
|
152
|
-
{ 'im_too_cool_to_vote_and_ill_only_ride_a_fixie' => 'hipster.id',
|
153
|
-
'really_im_not_doping_i_just_practice_a_lot' => 'professional.id' }
|
154
|
-
end
|
155
|
-
let(:options) { {} }
|
156
|
-
|
157
|
-
let(:trigger_sql) do
|
158
|
-
%{
|
159
|
-
DROP TRIGGER IF EXISTS pfki_bicycles_imtoocooltovoteandillonl_reallyimnotdopingijustpr
|
160
|
-
DROP TRIGGER IF EXISTS pfku_bicycles_imtoocooltovoteandillonl_reallyimnotdopingijustpr
|
161
|
-
CREATE TRIGGER pfki_bicycles_imtoocooltovoteandillonl_reallyimnotdopingijustpr BEFORE INSERT ON bicycles
|
162
|
-
FOR EACH ROW
|
163
|
-
BEGIN
|
164
|
-
IF(IF(NEW.im_too_cool_to_vote_and_ill_only_ride_a_fixie IS NULL, 0, 1) + IF(NEW.really_im_not_doping_i_just_practice_a_lot IS NULL, 0, 1)) <> 1 THEN
|
165
|
-
SET NEW = 'Error';
|
166
|
-
END IF;
|
167
|
-
END
|
168
|
-
CREATE TRIGGER pfku_bicycles_imtoocooltovoteandillonl_reallyimnotdopingijustpr BEFORE UPDATE ON bicycles
|
169
|
-
FOR EACH ROW
|
170
|
-
BEGIN
|
171
|
-
IF(IF(NEW.im_too_cool_to_vote_and_ill_only_ride_a_fixie IS NULL, 0, 1) + IF(NEW.really_im_not_doping_i_just_practice_a_lot IS NULL, 0, 1)) <> 1 THEN
|
172
|
-
SET NEW = 'Error';
|
173
|
-
END IF;
|
174
|
-
END
|
175
|
-
}
|
99
|
+
it_behaves_like "mysql2 migration statements"
|
176
100
|
end
|
177
101
|
|
178
|
-
|
179
|
-
|
180
|
-
ALTER TABLE `bicycles` ADD CONSTRAINT `bicycles_im_too_cool_to_vote_and_ill_only_ride_a_fixie_fk` FOREIGN KEY (`im_too_cool_to_vote_and_ill_only_ride_a_fixie`) REFERENCES `hipster`(id)
|
181
|
-
ALTER TABLE `bicycles` ADD CONSTRAINT `bicycles_really_im_not_doping_i_just_practice_a_lot_fk` FOREIGN KEY (`really_im_not_doping_i_just_practice_a_lot`) REFERENCES `professional`(id)
|
182
|
-
}
|
183
|
-
end
|
102
|
+
context "when table and column names combined are very long" do
|
103
|
+
include_context "columns with long names"
|
184
104
|
|
185
|
-
|
186
|
-
%{
|
187
|
-
CREATE UNIQUE INDEX pfk_blah
|
188
|
-
}
|
105
|
+
it_behaves_like "mysql2 migration statements"
|
189
106
|
end
|
190
|
-
|
191
|
-
let(:full_constraints_sql) { trigger_sql + fkey_sql }
|
192
|
-
|
193
|
-
it_behaves_like "migration statements"
|
194
107
|
end
|
195
108
|
|
196
|
-
|
197
|
-
|
198
109
|
describe "#triggers" do
|
199
110
|
let(:trigger1) { stub(Trigger, :name => '1') }
|
200
111
|
let(:trigger2) { stub(Trigger, :name => '2') }
|
@@ -209,10 +120,4 @@ describe Polymorpheus::ConnectionAdapters::MysqlAdapter do
|
|
209
120
|
connection.triggers.should == [trigger1, trigger2]
|
210
121
|
end
|
211
122
|
end
|
212
|
-
|
213
|
-
|
214
|
-
def clean_sql(sql_string)
|
215
|
-
sql_string.gsub(/^\n\s*/,'').gsub(/\s*\n\s*$/,'').gsub(/\n\s*/,"\n")
|
216
|
-
end
|
217
|
-
|
218
123
|
end
|
@@ -0,0 +1,115 @@
|
|
1
|
+
shared_examples_for "mysql2 migration statements" do
|
2
|
+
describe "#add_polymorphic_constraints" do
|
3
|
+
before { connection.add_polymorphic_constraints(table, columns, options) }
|
4
|
+
|
5
|
+
specify do
|
6
|
+
clean_sql(sql.join("\n")).should == clean_sql(full_constraints_sql)
|
7
|
+
end
|
8
|
+
end
|
9
|
+
|
10
|
+
describe "#add_polymorphic_triggers" do
|
11
|
+
before { connection.add_polymorphic_triggers(table, columns.keys) }
|
12
|
+
|
13
|
+
specify do
|
14
|
+
clean_sql(sql.join("\n")).should == clean_sql(trigger_sql)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
describe "#remove_polymorphic_constraints" do
|
19
|
+
before { connection.remove_polymorphic_constraints(table, columns, options) }
|
20
|
+
|
21
|
+
specify do
|
22
|
+
clean_sql(sql.join("\n")).should == clean_sql(remove_constraints_sql)
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
shared_context "columns with short names" do
|
28
|
+
let(:table) { 'pets' }
|
29
|
+
let(:columns) { { 'kitty_id' => 'cats.name', 'dog_id' => 'dogs.id' } }
|
30
|
+
let(:trigger_sql) do
|
31
|
+
%{
|
32
|
+
DROP TRIGGER IF EXISTS pfki_pets_dogid_kittyid
|
33
|
+
DROP TRIGGER IF EXISTS pfku_pets_dogid_kittyid
|
34
|
+
CREATE TRIGGER pfki_pets_dogid_kittyid BEFORE INSERT ON pets
|
35
|
+
FOR EACH ROW
|
36
|
+
BEGIN
|
37
|
+
IF(IF(NEW.dog_id IS NULL, 0, 1) + IF(NEW.kitty_id IS NULL, 0, 1)) <> 1 THEN
|
38
|
+
SET NEW = 'Error';
|
39
|
+
END IF;
|
40
|
+
END
|
41
|
+
CREATE TRIGGER pfku_pets_dogid_kittyid BEFORE UPDATE ON pets
|
42
|
+
FOR EACH ROW
|
43
|
+
BEGIN
|
44
|
+
IF(IF(NEW.dog_id IS NULL, 0, 1) + IF(NEW.kitty_id IS NULL, 0, 1)) <> 1 THEN
|
45
|
+
SET NEW = 'Error';
|
46
|
+
END IF;
|
47
|
+
END
|
48
|
+
}
|
49
|
+
end
|
50
|
+
let(:fkey_sql) do
|
51
|
+
%{
|
52
|
+
ALTER TABLE `pets` ADD CONSTRAINT `pets_dog_id_fk` FOREIGN KEY (`dog_id`) REFERENCES `dogs`(id)
|
53
|
+
ALTER TABLE `pets` ADD CONSTRAINT `pets_kitty_id_fk` FOREIGN KEY (`kitty_id`) REFERENCES `cats`(name)
|
54
|
+
}
|
55
|
+
end
|
56
|
+
let(:unique_key_sql) { '' }
|
57
|
+
let(:full_constraints_sql) { trigger_sql + unique_key_sql + fkey_sql }
|
58
|
+
let(:remove_indices_sql) { '' }
|
59
|
+
let(:remove_constraints_sql) do
|
60
|
+
%{
|
61
|
+
DROP TRIGGER IF EXISTS pfki_pets_dogid_kittyid
|
62
|
+
DROP TRIGGER IF EXISTS pfku_pets_dogid_kittyid
|
63
|
+
ALTER TABLE `pets` DROP FOREIGN KEY `pets_kitty_id_fk`
|
64
|
+
ALTER TABLE `pets` DROP FOREIGN KEY `pets_dog_id_fk`
|
65
|
+
} +
|
66
|
+
remove_indices_sql
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
shared_context "columns with long names" do
|
71
|
+
let(:table) { 'bicycles' }
|
72
|
+
let(:columns) do
|
73
|
+
{ 'im_too_cool_to_vote_and_ill_only_ride_a_fixie' => 'hipster.id',
|
74
|
+
'really_im_not_doping_i_just_practice_a_lot' => 'professional.id' }
|
75
|
+
end
|
76
|
+
let(:options) { {} }
|
77
|
+
|
78
|
+
let(:trigger_sql) do
|
79
|
+
%{
|
80
|
+
DROP TRIGGER IF EXISTS pfki_bicycles_imtoocooltovoteandillonl_reallyimnotdopingijustpr
|
81
|
+
DROP TRIGGER IF EXISTS pfku_bicycles_imtoocooltovoteandillonl_reallyimnotdopingijustpr
|
82
|
+
CREATE TRIGGER pfki_bicycles_imtoocooltovoteandillonl_reallyimnotdopingijustpr BEFORE INSERT ON bicycles
|
83
|
+
FOR EACH ROW
|
84
|
+
BEGIN
|
85
|
+
IF(IF(NEW.im_too_cool_to_vote_and_ill_only_ride_a_fixie IS NULL, 0, 1) + IF(NEW.really_im_not_doping_i_just_practice_a_lot IS NULL, 0, 1)) <> 1 THEN
|
86
|
+
SET NEW = 'Error';
|
87
|
+
END IF;
|
88
|
+
END
|
89
|
+
CREATE TRIGGER pfku_bicycles_imtoocooltovoteandillonl_reallyimnotdopingijustpr BEFORE UPDATE ON bicycles
|
90
|
+
FOR EACH ROW
|
91
|
+
BEGIN
|
92
|
+
IF(IF(NEW.im_too_cool_to_vote_and_ill_only_ride_a_fixie IS NULL, 0, 1) + IF(NEW.really_im_not_doping_i_just_practice_a_lot IS NULL, 0, 1)) <> 1 THEN
|
93
|
+
SET NEW = 'Error';
|
94
|
+
END IF;
|
95
|
+
END
|
96
|
+
}
|
97
|
+
end
|
98
|
+
|
99
|
+
let(:fkey_sql) do
|
100
|
+
%{
|
101
|
+
ALTER TABLE `bicycles` ADD CONSTRAINT `bicycles_im_too_cool_to_vote_and_ill_only_ride_a_fixie_fk` FOREIGN KEY (`im_too_cool_to_vote_and_ill_only_ride_a_fixie`) REFERENCES `hipster`(id)
|
102
|
+
ALTER TABLE `bicycles` ADD CONSTRAINT `bicycles_really_im_not_doping_i_just_practice_a_lot_fk` FOREIGN KEY (`really_im_not_doping_i_just_practice_a_lot`) REFERENCES `professional`(id)
|
103
|
+
}
|
104
|
+
end
|
105
|
+
|
106
|
+
let(:full_constraints_sql) { trigger_sql + fkey_sql }
|
107
|
+
let(:remove_constraints_sql) do
|
108
|
+
%{
|
109
|
+
DROP TRIGGER IF EXISTS pfki_bicycles_imtoocooltovoteandillonl_reallyimnotdopingijustpr
|
110
|
+
DROP TRIGGER IF EXISTS pfku_bicycles_imtoocooltovoteandillonl_reallyimnotdopingijustpr
|
111
|
+
ALTER TABLE `bicycles` DROP FOREIGN KEY `bicycles_im_too_cool_to_vote_and_ill_only_ride_a_fixie_fk`
|
112
|
+
ALTER TABLE `bicycles` DROP FOREIGN KEY `bicycles_really_im_not_doping_i_just_practice_a_lot_fk`
|
113
|
+
}
|
114
|
+
end
|
115
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: polymorpheus
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 1.1.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-10-27 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: foreigner
|
16
|
-
requirement: &
|
16
|
+
requirement: &70167733248880 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,7 +21,40 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70167733248880
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: activerecord
|
27
|
+
requirement: &70167733248340 !ruby/object:Gem::Requirement
|
28
|
+
none: false
|
29
|
+
requirements:
|
30
|
+
- - ! '>='
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '3.0'
|
33
|
+
type: :runtime
|
34
|
+
prerelease: false
|
35
|
+
version_requirements: *70167733248340
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
name: rspec-rails
|
38
|
+
requirement: &70167733247920 !ruby/object:Gem::Requirement
|
39
|
+
none: false
|
40
|
+
requirements:
|
41
|
+
- - ! '>='
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: '0'
|
44
|
+
type: :development
|
45
|
+
prerelease: false
|
46
|
+
version_requirements: *70167733247920
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: mysql2
|
49
|
+
requirement: &70167733247460 !ruby/object:Gem::Requirement
|
50
|
+
none: false
|
51
|
+
requirements:
|
52
|
+
- - ! '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
type: :development
|
56
|
+
prerelease: false
|
57
|
+
version_requirements: *70167733247460
|
25
58
|
description: Provides a database-friendly method for polymorphic relationships
|
26
59
|
email: bsingh@wegowise.com
|
27
60
|
executables: []
|
@@ -42,6 +75,7 @@ files:
|
|
42
75
|
- spec/interface_spec.rb
|
43
76
|
- spec/mysql2_adapter_spec.rb
|
44
77
|
- spec/schema_dumper_spec.rb
|
78
|
+
- spec/shared_examples.rb
|
45
79
|
- spec/spec_helper.rb
|
46
80
|
- spec/sql_logger.rb
|
47
81
|
- spec/trigger_spec.rb
|
@@ -62,9 +96,6 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
62
96
|
- - ! '>='
|
63
97
|
- !ruby/object:Gem::Version
|
64
98
|
version: '0'
|
65
|
-
segments:
|
66
|
-
- 0
|
67
|
-
hash: 2769054126994398138
|
68
99
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
69
100
|
none: false
|
70
101
|
requirements:
|