ez_model 1.0.8 → 1.0.9

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.
@@ -1,3 +1,3 @@
1
1
  module EZModel
2
- VERSION = "1.0.8" unless defined?(::EZModel::VERSION)
2
+ VERSION = "1.0.9" unless defined?(::EZModel::VERSION)
3
3
  end
@@ -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
@@ -44,10 +44,10 @@ module Rmre
44
44
  def create_model(table_name)
45
45
  constraints = []
46
46
 
47
- #foreign_keys.each do |fk|
48
- # src = constraint_src(table_name, fk)
49
- # constraints << src unless src.nil?
50
- #end
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.8
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-18 00:00:00.000000000 Z
12
+ date: 2012-06-21 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activerecord