rmap 0.1.1 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/rmap/table.rb +6 -3
- data/lib/rmap/version.rb +1 -1
- data/rmap.gemspec +4 -4
- metadata +13 -13
data/lib/rmap/table.rb
CHANGED
@@ -88,6 +88,9 @@ module Rmap
|
|
88
88
|
all.map{|row| row.fetch(name).first}
|
89
89
|
elsif column?(name.to_s.sub(/=\Z/, "")) && name.match(/\A(.*)=\Z/)
|
90
90
|
all.each{|row| row.update($1 => args[0])}
|
91
|
+
elsif name.match /\A(.*?)_(#{BINARY_FILTER_METHODS.keys.join('|')})\Z/
|
92
|
+
@binary_filter_methods_args[$2].push([$1,args[0]])
|
93
|
+
self
|
91
94
|
else
|
92
95
|
super
|
93
96
|
end
|
@@ -168,10 +171,10 @@ module Rmap
|
|
168
171
|
"#{table1.name}.#{foreign_key} = #{table2.name}.id"
|
169
172
|
end
|
170
173
|
else
|
171
|
-
if table2.column? "#{table1.name}_id"
|
172
|
-
"#{table1.name}.id = #{table2.name}.#{table1.name}_id"
|
174
|
+
if table2.column? "#{table1.name.to_s.gsub(/ies\Z/, "y").gsub(/s\Z/, "")}_id"
|
175
|
+
"#{table1.name}.id = #{table2.name.to_s.gsub(/ies\Z/, "y").gsub(/s\Z/, "")}.#{table1.name}_id"
|
173
176
|
else
|
174
|
-
"#{table1.name}.#{table2.name}_id = #{table2.name}.id"
|
177
|
+
"#{table1.name}.#{table2.name.to_s.gsub(/ies\Z/, "y").gsub(/s\Z/, "")}_id = #{table2.name}.id"
|
175
178
|
end
|
176
179
|
end
|
177
180
|
end
|
data/lib/rmap/version.rb
CHANGED
data/rmap.gemspec
CHANGED
@@ -17,9 +17,9 @@ Gem::Specification.new do |s|
|
|
17
17
|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
18
18
|
s.require_paths = ["lib"]
|
19
19
|
|
20
|
-
s.add_dependency "mysql2", "~> 0
|
21
|
-
s.add_dependency "json", "~> 1
|
22
|
-
s.add_dependency "ripl", "~> 0
|
23
|
-
s.add_dependency "ripl-multi_line", "~> 0
|
20
|
+
s.add_dependency "mysql2", "~> 0"
|
21
|
+
s.add_dependency "json", "~> 1"
|
22
|
+
s.add_dependency "ripl", "~> 0"
|
23
|
+
s.add_dependency "ripl-multi_line", "~> 0"
|
24
24
|
|
25
25
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rmap
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,48 +13,48 @@ date: 2012-05-10 00:00:00.000000000Z
|
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: mysql2
|
16
|
-
requirement: &
|
16
|
+
requirement: &82818880 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version: '0
|
21
|
+
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *82818880
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: json
|
27
|
-
requirement: &
|
27
|
+
requirement: &82818630 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ~>
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version: '1
|
32
|
+
version: '1'
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *82818630
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: ripl
|
38
|
-
requirement: &
|
38
|
+
requirement: &82818400 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ~>
|
42
42
|
- !ruby/object:Gem::Version
|
43
|
-
version: '0
|
43
|
+
version: '0'
|
44
44
|
type: :runtime
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *82818400
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: ripl-multi_line
|
49
|
-
requirement: &
|
49
|
+
requirement: &82818170 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ~>
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '0
|
54
|
+
version: '0'
|
55
55
|
type: :runtime
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *82818170
|
58
58
|
description:
|
59
59
|
email:
|
60
60
|
- jody@jodysalt.com
|