ez_model 1.0.8 → 1.0.9
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/ez_model/version.rb +1 -1
- data/lib/rmre/active_record/schema_dumper.rb +6 -6
- data/lib/rmre/generator.rb +4 -4
- metadata +2 -2
data/lib/ez_model/version.rb
CHANGED
@@ -13,12 +13,12 @@ module ActiveRecord
|
|
13
13
|
header(stream)
|
14
14
|
tables(stream)
|
15
15
|
|
16
|
-
foreign_keys.each do |fk|
|
17
|
-
stream.puts <<-SQL
|
18
|
-
execute "ALTER TABLE #{fk['from_table']} ADD CONSTRAINT fk_#{fk['from_table']}_#{fk['to_table']}
|
19
|
-
FOREIGN KEY (#{fk['from_column']}) REFERENCES #{fk['to_table']}(#{fk['to_column']})"
|
20
|
-
SQL
|
21
|
-
end
|
16
|
+
# foreign_keys.each do |fk|
|
17
|
+
#stream.puts <<-SQL
|
18
|
+
# execute "ALTER TABLE #{fk['from_table']} ADD CONSTRAINT fk_#{fk['from_table']}_#{fk['to_table']}
|
19
|
+
# FOREIGN KEY (#{fk['from_column']}) REFERENCES #{fk['to_table']}(#{fk['to_column']})"
|
20
|
+
# SQL
|
21
|
+
# end
|
22
22
|
|
23
23
|
trailer(stream)
|
24
24
|
stream
|
data/lib/rmre/generator.rb
CHANGED
@@ -44,10 +44,10 @@ module Rmre
|
|
44
44
|
def create_model(table_name)
|
45
45
|
constraints = []
|
46
46
|
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
47
|
+
foreign_keys.each do |fk|
|
48
|
+
src = constraint_src(table_name, fk)
|
49
|
+
constraints << src unless src.nil?
|
50
|
+
end
|
51
51
|
|
52
52
|
_file_path = File.join(output_path, "#{table_name.tableize.singularize}.rb")
|
53
53
|
if (!File.exists?(_file_path))
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ez_model
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.9
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-06-
|
12
|
+
date: 2012-06-21 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activerecord
|