activerecord 3.1.11 → 3.1.12

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.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b0b0e3dda9642a618a998223568a92014fd55475
4
- data.tar.gz: 719b6bde220e0abd79e27b6457c92d8ce8bb511b
3
+ metadata.gz: 39618d1c6a68e5b4619c40b74c4ce99a97c6e316
4
+ data.tar.gz: 0aff9db1c8dc331c7f293a7e9a80bfa6343d8d04
5
5
  SHA512:
6
- metadata.gz: 53b2dbbc486b8b41dd447b6cdf66d1ca264c44ecc818cf1ef993ccc2e6a3d8b515f074c093f4d6e32908ca89bd6ed74673f97183c2c7310a065a06308b550bb7
7
- data.tar.gz: b161018a09558875e58f7773aef6953f8bfeada2f21c98423de067f6c2d97e2680a43e6365426e040e5e79e49dd006687ada6c8941bcc7c214ac11f09ebbf5b7
6
+ metadata.gz: 9960b003f80c2a2abb86ee83e854c763af29fcaeb4eb01f1da4ebc865d945e9b4c30292e8d635275451a1c8fcb3e2ccdc3f6c7e7ece37578bd9a74fc674325e2
7
+ data.tar.gz: aaf2fa286f74dd1d9a81f55a0048e6405a50019d67974a4b17d59ed7065ecb380edc8496222ad2e7ed65ccd07756bd44535c1a4feb1e68a076a5656df18847a1
@@ -1,4 +1,11 @@
1
- ## Rails 3.1.11 (unreleased) ##
1
+ ## unreleased ##
2
+
3
+ * Reverted 921a296a3390192a71abeec6d9a035cc6d1865c8, 'Quote numeric values
4
+ compared to string columns.' This caused several regressions.
5
+
6
+ *Steve Klabnik*
7
+
8
+ ## Rails 3.1.11 (Feb 11, 2011) ##
2
9
 
3
10
  * Quote numeric values being compared to non-numeric columns. Otherwise,
4
11
  in some database, the string column values will be coerced to a numeric
@@ -25,19 +25,13 @@ module ActiveRecord
25
25
  when true, false
26
26
  if column && column.type == :integer
27
27
  value ? '1' : '0'
28
- elsif column && [:text, :string, :binary].include?(column.type)
29
- value ? "'1'" : "'0'"
30
28
  else
31
29
  value ? quoted_true : quoted_false
32
30
  end
33
31
  # BigDecimals need to be put in a non-normalized form and quoted.
34
32
  when nil then "NULL"
35
- when Numeric, ActiveSupport::Duration
36
- value = BigDecimal === value ? value.to_s('F') : value.to_s
37
- if column && ![:integer, :float, :decimal].include?(column.type)
38
- value = "'#{value}'"
39
- end
40
- value
33
+ when BigDecimal then value.to_s('F')
34
+ when Numeric then value.to_s
41
35
  when Date, Time then "'#{quoted_date(value)}'"
42
36
  when Symbol then "'#{quote_string(value.to_s)}'"
43
37
  else
@@ -403,7 +403,7 @@ module ActiveRecord
403
403
  node.left.relation.name == table_name
404
404
  }
405
405
 
406
- Hash[equalities.map { |where| [where.left.name, where.right] }]
406
+ Hash[equalities.map { |where| [where.left.name, where.right] }].with_indifferent_access
407
407
  end
408
408
 
409
409
  def scope_for_create
@@ -20,7 +20,7 @@ module ActiveRecord
20
20
  table = Arel::Table.new(table_name, engine)
21
21
  end
22
22
 
23
- attribute = table[column.to_sym]
23
+ attribute = table[column]
24
24
 
25
25
  case value
26
26
  when ActiveRecord::Relation
@@ -49,10 +49,6 @@ module ActiveRecord
49
49
  when Class
50
50
  # FIXME: I think we need to deprecate this behavior
51
51
  attribute.eq(value.name)
52
- when Integer, ActiveSupport::Duration
53
- # Arel treats integers as literals, but they should be quoted when compared with strings
54
- column = engine.connection_pool.columns_hash[table.name][attribute.name.to_s]
55
- attribute.eq(Arel::Nodes::SqlLiteral.new(engine.connection.quote(value, column)))
56
52
  else
57
53
  attribute.eq(value)
58
54
  end
@@ -2,7 +2,7 @@ module ActiveRecord
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 3
4
4
  MINOR = 1
5
- TINY = 11
5
+ TINY = 12
6
6
  PRE = nil
7
7
 
8
8
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join('.')
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activerecord
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.11
4
+ version: 3.1.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Heinemeier Hansson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-02-11 00:00:00.000000000 Z
11
+ date: 2013-03-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -16,54 +16,54 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 3.1.11
19
+ version: 3.1.12
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 3.1.11
26
+ version: 3.1.12
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: activemodel
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - '='
32
32
  - !ruby/object:Gem::Version
33
- version: 3.1.11
33
+ version: 3.1.12
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - '='
39
39
  - !ruby/object:Gem::Version
40
- version: 3.1.11
40
+ version: 3.1.12
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: arel
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - "~>"
45
+ - - ~>
46
46
  - !ruby/object:Gem::Version
47
47
  version: 2.2.3
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - "~>"
52
+ - - ~>
53
53
  - !ruby/object:Gem::Version
54
54
  version: 2.2.3
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: tzinfo
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - "~>"
59
+ - - ~>
60
60
  - !ruby/object:Gem::Version
61
61
  version: 0.3.29
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - "~>"
66
+ - - ~>
67
67
  - !ruby/object:Gem::Version
68
68
  version: 0.3.29
69
69
  description: Databases on Rails. Build a persistent domain model by mapping database
@@ -209,23 +209,23 @@ licenses: []
209
209
  metadata: {}
210
210
  post_install_message:
211
211
  rdoc_options:
212
- - "--main"
212
+ - --main
213
213
  - README.rdoc
214
214
  require_paths:
215
215
  - lib
216
216
  required_ruby_version: !ruby/object:Gem::Requirement
217
217
  requirements:
218
- - - ">="
218
+ - - '>='
219
219
  - !ruby/object:Gem::Version
220
220
  version: 1.8.7
221
221
  required_rubygems_version: !ruby/object:Gem::Requirement
222
222
  requirements:
223
- - - ">="
223
+ - - '>='
224
224
  - !ruby/object:Gem::Version
225
225
  version: '0'
226
226
  requirements: []
227
227
  rubyforge_project:
228
- rubygems_version: 2.0.0.rc.2
228
+ rubygems_version: 2.0.2
229
229
  signing_key:
230
230
  specification_version: 4
231
231
  summary: Object-relational mapper framework (part of Rails).