activerecord 3.1.5.rc1 → 3.1.5

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.

@@ -1,3 +1,14 @@
1
+ ## Rails 3.1.5 (May 31, 2012) ##
2
+
3
+ * Fix type_to_sql with text and limit on mysql/mysql2. Fix GH #3931.
4
+
5
+ * only log an error if there is a logger. fixes #5226
6
+
7
+ * fix activerecord query_method regression with offset into Fixnum
8
+
9
+ * predicate builder should not recurse for determining where columns.
10
+ Thanks to Ben Murphy for reporting this! CVE-2012-2661
11
+
1
12
  ## Rails 3.1.4 (unreleased) ##
2
13
 
3
14
  * Fix a custom primary key regression *GH 3987*
@@ -87,7 +87,7 @@ module ActiveRecord
87
87
 
88
88
  conditions.each do |condition|
89
89
  if options[:through] && condition.is_a?(Hash)
90
- condition = { table.name => condition }
90
+ condition = disambiguate_condition(table, condition)
91
91
  end
92
92
 
93
93
  scope = scope.where(interpolate(condition))
@@ -126,6 +126,21 @@ module ActiveRecord
126
126
  end
127
127
  end
128
128
 
129
+ def disambiguate_condition(table, condition)
130
+ if condition.is_a?(Hash)
131
+ Hash[
132
+ condition.map do |k, v|
133
+ if v.is_a?(Hash)
134
+ [k, v]
135
+ else
136
+ [table.table_alias || table.name, { k => v }]
137
+ end
138
+ end
139
+ ]
140
+ else
141
+ condition
142
+ end
143
+ end
129
144
  end
130
145
  end
131
146
  end
@@ -1,16 +1,16 @@
1
1
  module ActiveRecord
2
2
  class PredicateBuilder # :nodoc:
3
- def self.build_from_hash(engine, attributes, default_table)
3
+ def self.build_from_hash(engine, attributes, default_table, check_column = true)
4
4
  predicates = attributes.map do |column, value|
5
5
  table = default_table
6
6
 
7
7
  if value.is_a?(Hash)
8
8
  table = Arel::Table.new(column, engine)
9
- build_from_hash(engine, value, table)
9
+ build_from_hash(engine, value, table, false)
10
10
  else
11
11
  column = column.to_s
12
12
 
13
- if column.include?('.')
13
+ if check_column && column.include?('.')
14
14
  table_name, column = column.split('.', 2)
15
15
  table = Arel::Table.new(table_name, engine)
16
16
  end
@@ -3,7 +3,7 @@ module ActiveRecord
3
3
  MAJOR = 3
4
4
  MINOR = 1
5
5
  TINY = 5
6
- PRE = "rc1"
6
+ PRE = nil
7
7
 
8
8
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join('.')
9
9
  end
metadata CHANGED
@@ -1,15 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activerecord
3
3
  version: !ruby/object:Gem::Version
4
- hash: 1335462739
5
- prerelease: 6
4
+ hash: 9
5
+ prerelease:
6
6
  segments:
7
7
  - 3
8
8
  - 1
9
9
  - 5
10
- - rc
11
- - 1
12
- version: 3.1.5.rc1
10
+ version: 3.1.5
13
11
  platform: ruby
14
12
  authors:
15
13
  - David Heinemeier Hansson
@@ -17,7 +15,7 @@ autorequire:
17
15
  bindir: bin
18
16
  cert_chain: []
19
17
 
20
- date: 2012-05-28 00:00:00 Z
18
+ date: 2012-05-31 00:00:00 Z
21
19
  dependencies:
22
20
  - !ruby/object:Gem::Dependency
23
21
  name: activesupport
@@ -27,14 +25,12 @@ dependencies:
27
25
  requirements:
28
26
  - - "="
29
27
  - !ruby/object:Gem::Version
30
- hash: 1335462739
28
+ hash: 9
31
29
  segments:
32
30
  - 3
33
31
  - 1
34
32
  - 5
35
- - rc
36
- - 1
37
- version: 3.1.5.rc1
33
+ version: 3.1.5
38
34
  type: :runtime
39
35
  version_requirements: *id001
40
36
  - !ruby/object:Gem::Dependency
@@ -45,14 +41,12 @@ dependencies:
45
41
  requirements:
46
42
  - - "="
47
43
  - !ruby/object:Gem::Version
48
- hash: 1335462739
44
+ hash: 9
49
45
  segments:
50
46
  - 3
51
47
  - 1
52
48
  - 5
53
- - rc
54
- - 1
55
- version: 3.1.5.rc1
49
+ version: 3.1.5
56
50
  type: :runtime
57
51
  version_requirements: *id002
58
52
  - !ruby/object:Gem::Dependency
@@ -248,14 +242,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
248
242
  required_rubygems_version: !ruby/object:Gem::Requirement
249
243
  none: false
250
244
  requirements:
251
- - - ">"
245
+ - - ">="
252
246
  - !ruby/object:Gem::Version
253
- hash: 25
247
+ hash: 3
254
248
  segments:
255
- - 1
256
- - 3
257
- - 1
258
- version: 1.3.1
249
+ - 0
250
+ version: "0"
259
251
  requirements: []
260
252
 
261
253
  rubyforge_project: