meta_field 0.0.1.1 → 0.0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +6 -14
- data/lib/meta_field/extension.rb +2 -1
- data/lib/meta_field/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,15 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
metadata.gz: !binary |-
|
9
|
-
NmUyZmNkNzJjYTI0MDU2ZTVmOTY4NzQ1NGZkNWZkYTFkMmQ4MDVlZTg4MTEx
|
10
|
-
NTYzNzE4OTQ0YzI5NWU3Y2UyYmM3NTk2OWIyN2E5OTMwOWViNjVjNGExMWQ1
|
11
|
-
OTI0NGJkNmVmNmRhOGJhOGEyYTRkMjUyYzlkOTBiYzBkMmZjZTg=
|
12
|
-
data.tar.gz: !binary |-
|
13
|
-
ZTE0NzY2ZTcyZTk3ZjMwNThiNjNhMTJkMGQ5MTgzYWU4YmMwMDczNjJmM2Q2
|
14
|
-
ODMxZTczYTA5Y2UyYjQ3MThkZjBiMTM4NTMwMGQzYmVkOGY0N2U4OGVjZWI0
|
15
|
-
YTYyM2MyYjdlOTJiMjJjZGRlNzkwOWVkZWYwMzE1M2ZjYmM4YjM=
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: d6ce1b7d164c34824a4e57b6df68cb5d94f9aadc
|
4
|
+
data.tar.gz: a061ff63f9908ec451d2467b316a5d6265c9b650
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 5c5df19d9cac7c589b12da524018dc9f58ff10e0c5b9e0502d3ce6262a56207b1815fec85c3aab8d92a9a8e20458f27d32e4a10ab79ad5b8db2cfc8fc2f9fbb7
|
7
|
+
data.tar.gz: d6bb8ec733a76b9d2b0c4d335dae02e64369ad1c953f054e14f350ff009c62b88811ee9e46cf46572c19a22795ddd75a76fdb688fe7bbfedde6eeed6ae8ecbb9
|
data/lib/meta_field/extension.rb
CHANGED
@@ -70,11 +70,12 @@ module MetaField
|
|
70
70
|
query = scoped
|
71
71
|
basenames.each{ |basename, where_cond|
|
72
72
|
quoted_basename = connection.quote_string(basename.to_s)
|
73
|
+
join_table_name = "#{basename}_tbl"
|
73
74
|
sub = MetaField::Meta.arel_table
|
74
75
|
sub = sub.where(sub[:basename].eq(basename))
|
75
76
|
sub = sub.where(where_cond) if where_cond
|
76
77
|
sub = sub.project(Arel.sql("#{connection.quote_column_name('obj_id')} as #{ connection.quote_column_name(quoted_basename+'_obj_id') }, #{connection.quote_column_name(meta_fields[basename.to_sym][0])} as #{connection.quote_column_name(quoted_basename)}"))
|
77
|
-
query = query.joins("INNER JOIN (#{ sub.to_sql }) ON #{connection.quote_table_name(table_name)}.#{connection.quote_column_name('id')} = #{connection.quote_column_name(quoted_basename+'_obj_id')}")
|
78
|
+
query = query.joins("INNER JOIN (#{ sub.to_sql }) as #{ connection.quote_table_name(join_table_name) } ON #{connection.quote_table_name(table_name)}.#{connection.quote_column_name('id')} = #{ connection.quote_table_name(join_table_name) }.#{connection.quote_column_name(quoted_basename+'_obj_id')}")
|
78
79
|
}
|
79
80
|
query
|
80
81
|
end
|
data/lib/meta_field/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: meta_field
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.1.
|
4
|
+
version: 0.0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yuichi Takeuchi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-03-
|
11
|
+
date: 2013-03-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -52,12 +52,12 @@ require_paths:
|
|
52
52
|
- lib
|
53
53
|
required_ruby_version: !ruby/object:Gem::Requirement
|
54
54
|
requirements:
|
55
|
-
- -
|
55
|
+
- - '>='
|
56
56
|
- !ruby/object:Gem::Version
|
57
57
|
version: '0'
|
58
58
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
59
59
|
requirements:
|
60
|
-
- -
|
60
|
+
- - '>='
|
61
61
|
- !ruby/object:Gem::Version
|
62
62
|
version: '0'
|
63
63
|
requirements: []
|