redhillonrails_core 1.1.1 → 1.1.2
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.
@@ -20,7 +20,7 @@ module RedhillonrailsCore
|
|
20
20
|
end
|
21
21
|
|
22
22
|
def to_sql
|
23
|
-
sql = name ? "CONSTRAINT #{
|
23
|
+
sql = name ? "CONSTRAINT #{name} " : ""
|
24
24
|
sql << "FOREIGN KEY (#{quoted_column_names.join(", ")}) REFERENCES #{quoted_references_table_name} (#{quoted_references_column_names.join(", ")})"
|
25
25
|
sql << " ON UPDATE #{ACTIONS[on_update]}" if on_update
|
26
26
|
sql << " ON DELETE #{ACTIONS[on_delete]}" if on_delete
|
data/redhillonrails_core.gemspec
CHANGED
@@ -7,7 +7,7 @@ describe "Foreign Key definition" do
|
|
7
7
|
let(:definition) { RedhillonrailsCore::ActiveRecord::ConnectionAdapters::ForeignKeyDefinition.new("posts_user_fkey", :posts, :user, :users, :id) }
|
8
8
|
|
9
9
|
it "it is dumped to sql with quoted values" do
|
10
|
-
definition.to_sql.should == %Q{CONSTRAINT
|
10
|
+
definition.to_sql.should == %Q{CONSTRAINT posts_user_fkey FOREIGN KEY (#{quote_column_name('user')}) REFERENCES #{quote_table_name('users')} (#{quote_column_name('id')})}
|
11
11
|
end
|
12
12
|
|
13
13
|
def quote_table_name(table)
|
@@ -18,8 +18,4 @@ describe "Foreign Key definition" do
|
|
18
18
|
ActiveRecord::Base.connection.quote_column_name(column)
|
19
19
|
end
|
20
20
|
|
21
|
-
def quote(name)
|
22
|
-
ActiveRecord::Base.connection.quote(name)
|
23
|
-
end
|
24
|
-
|
25
21
|
end
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 1
|
7
7
|
- 1
|
8
|
-
-
|
9
|
-
version: 1.1.
|
8
|
+
- 2
|
9
|
+
version: 1.1.2
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- "Micha\xC5\x82 \xC5\x81omnicki"
|
@@ -169,7 +169,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
169
169
|
requirements:
|
170
170
|
- - ">="
|
171
171
|
- !ruby/object:Gem::Version
|
172
|
-
hash:
|
172
|
+
hash: -983253727
|
173
173
|
segments:
|
174
174
|
- 0
|
175
175
|
version: "0"
|