activerecord 3.0.6.rc1 → 3.0.6.rc2
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of activerecord might be problematic. Click here for more details.
@@ -102,7 +102,7 @@ module ActiveRecord
|
|
102
102
|
# Returns the SQL string that corresponds to the <tt>:conditions</tt>
|
103
103
|
# option of the macro, if given, or +nil+ otherwise.
|
104
104
|
def conditions
|
105
|
-
@conditions ||= @reflection.
|
105
|
+
@conditions ||= interpolate_sanitized_sql(@reflection.sanitized_conditions) if @reflection.sanitized_conditions
|
106
106
|
end
|
107
107
|
alias :sql_conditions :conditions
|
108
108
|
|
@@ -161,6 +161,10 @@ module ActiveRecord
|
|
161
161
|
@reflection.options[:dependent]
|
162
162
|
end
|
163
163
|
|
164
|
+
def interpolate_sanitized_sql(sql, record = nil, sanitize_klass = @reflection.klass)
|
165
|
+
@owner.send(:interpolate_sanitized_sql, sql, record, sanitize_klass)
|
166
|
+
end
|
167
|
+
|
164
168
|
def interpolate_and_sanitize_sql(sql, record = nil, sanitize_klass = @reflection.klass)
|
165
169
|
@owner.send(:interpolate_and_sanitize_sql, sql, record, sanitize_klass)
|
166
170
|
end
|
data/lib/active_record/base.rb
CHANGED
@@ -1732,7 +1732,10 @@ MSG
|
|
1732
1732
|
|
1733
1733
|
def interpolate_and_sanitize_sql(sql, record = nil, sanitize_klass = self.class)
|
1734
1734
|
sanitized = sanitize_klass.send(:sanitize_sql, sql)
|
1735
|
+
interpolate_sanitized_sql(sanitized, record, sanitize_klass)
|
1736
|
+
end
|
1735
1737
|
|
1738
|
+
def interpolate_sanitized_sql(sanitized, record = nil, sanitize_klass = self.class)
|
1736
1739
|
if sanitized =~ /\#\{.*\}/
|
1737
1740
|
ActiveSupport::Deprecation.warn(
|
1738
1741
|
'String-based interpolation of association conditions is deprecated. Please use a ' \
|
@@ -1740,8 +1743,8 @@ MSG
|
|
1740
1743
|
'should be changed to has_many :older_friends, :conditions => proc { "age > #{age}" }.'
|
1741
1744
|
)
|
1742
1745
|
instance_eval("%@#{sanitized.gsub('@', '\@')}@", __FILE__, __LINE__)
|
1743
|
-
elsif
|
1744
|
-
sanitize_klass.send(:sanitize_sql, instance_exec(record, &
|
1746
|
+
elsif sanitized.respond_to?(:to_proc)
|
1747
|
+
sanitize_klass.send(:sanitize_sql, instance_exec(record, &sanitized))
|
1745
1748
|
else
|
1746
1749
|
sanitized
|
1747
1750
|
end
|
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activerecord
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 15424065
|
5
5
|
prerelease: 6
|
6
6
|
segments:
|
7
7
|
- 3
|
8
8
|
- 0
|
9
9
|
- 6
|
10
10
|
- rc
|
11
|
-
-
|
12
|
-
version: 3.0.6.
|
11
|
+
- 2
|
12
|
+
version: 3.0.6.rc2
|
13
13
|
platform: ruby
|
14
14
|
authors:
|
15
15
|
- David Heinemeier Hansson
|
@@ -17,7 +17,7 @@ autorequire:
|
|
17
17
|
bindir: bin
|
18
18
|
cert_chain: []
|
19
19
|
|
20
|
-
date: 2011-03-
|
20
|
+
date: 2011-03-30 00:00:00 -07:00
|
21
21
|
default_executable:
|
22
22
|
dependencies:
|
23
23
|
- !ruby/object:Gem::Dependency
|
@@ -28,14 +28,14 @@ dependencies:
|
|
28
28
|
requirements:
|
29
29
|
- - "="
|
30
30
|
- !ruby/object:Gem::Version
|
31
|
-
hash:
|
31
|
+
hash: 15424065
|
32
32
|
segments:
|
33
33
|
- 3
|
34
34
|
- 0
|
35
35
|
- 6
|
36
36
|
- rc
|
37
|
-
-
|
38
|
-
version: 3.0.6.
|
37
|
+
- 2
|
38
|
+
version: 3.0.6.rc2
|
39
39
|
type: :runtime
|
40
40
|
version_requirements: *id001
|
41
41
|
- !ruby/object:Gem::Dependency
|
@@ -46,14 +46,14 @@ dependencies:
|
|
46
46
|
requirements:
|
47
47
|
- - "="
|
48
48
|
- !ruby/object:Gem::Version
|
49
|
-
hash:
|
49
|
+
hash: 15424065
|
50
50
|
segments:
|
51
51
|
- 3
|
52
52
|
- 0
|
53
53
|
- 6
|
54
54
|
- rc
|
55
|
-
-
|
56
|
-
version: 3.0.6.
|
55
|
+
- 2
|
56
|
+
version: 3.0.6.rc2
|
57
57
|
type: :runtime
|
58
58
|
version_requirements: *id002
|
59
59
|
- !ruby/object:Gem::Dependency
|