activerecord 2.3.12 → 2.3.14

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.

data/Rakefile CHANGED
@@ -192,7 +192,7 @@ spec = Gem::Specification.new do |s|
192
192
  s.files = s.files + Dir.glob( "#{dir}/**/*" ).delete_if { |item| item.include?( "\.svn" ) }
193
193
  end
194
194
 
195
- s.add_dependency('activesupport', '= 2.3.12' + PKG_BUILD)
195
+ s.add_dependency('activesupport', '= 2.3.14' + PKG_BUILD)
196
196
 
197
197
  s.files.delete FIXTURES_ROOT + "/fixture_database.sqlite"
198
198
  s.files.delete FIXTURES_ROOT + "/fixture_database_2.sqlite"
@@ -238,7 +238,7 @@ module ActiveRecord
238
238
  end
239
239
 
240
240
  def quote_column_name(name) #:nodoc:
241
- @quoted_column_names[name] ||= "`#{name}`"
241
+ @quoted_column_names[name] ||= "`#{name.to_s.gsub('`', '``')}`"
242
242
  end
243
243
 
244
244
  def quote_table_name(name) #:nodoc:
@@ -162,7 +162,7 @@ module ActiveRecord
162
162
  end
163
163
 
164
164
  def quote_column_name(name) #:nodoc:
165
- %Q("#{name}")
165
+ %Q("#{name.to_s.gsub('"', '""')}")
166
166
  end
167
167
 
168
168
 
@@ -333,7 +333,6 @@ module ActiveRecord
333
333
  end
334
334
 
335
335
  def generate_message(attribute, message = :invalid, options = {})
336
- ActiveSupport::Deprecation.warn("ActiveRecord::Errors#generate_message has been deprecated. Please use ActiveRecord::Error.new().to_s.")
337
336
  Error.new(@base, attribute, message, options).to_s
338
337
  end
339
338
  end
@@ -2,7 +2,7 @@ module ActiveRecord
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 2
4
4
  MINOR = 3
5
- TINY = 12
5
+ TINY = 14
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  end
@@ -79,6 +79,23 @@ end
79
79
  class BasicsTest < ActiveRecord::TestCase
80
80
  fixtures :topics, :companies, :developers, :projects, :computers, :accounts, :minimalistics, 'warehouse-things', :authors, :categorizations, :categories, :posts
81
81
 
82
+ def test_column_names_are_escaped
83
+ conn = ActiveRecord::Base.connection
84
+ classname = conn.class.name[/[^:]*$/]
85
+ badchar = {
86
+ 'SQLite3Adapter' => '"',
87
+ 'MysqlAdapter' => '`',
88
+ 'Mysql2Adapter' => '`',
89
+ 'PostgreSQLAdapter' => '"',
90
+ 'OracleAdapter' => '"',
91
+ }.fetch(classname) {
92
+ raise "need a bad char for #{classname}"
93
+ }
94
+
95
+ quoted = conn.quote_column_name "foo#{badchar}bar"
96
+ assert_equal("#{badchar}foo#{badchar * 2}bar#{badchar}", quoted)
97
+ end
98
+
82
99
  def test_table_exists
83
100
  assert !NonExistentTable.table_exists?
84
101
  assert Topic.table_exists?
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activerecord
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 31
5
5
  prerelease:
6
6
  segments:
7
7
  - 2
8
8
  - 3
9
- - 12
10
- version: 2.3.12
9
+ - 14
10
+ version: 2.3.14
11
11
  platform: ruby
12
12
  authors:
13
13
  - David Heinemeier Hansson
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-06-08 00:00:00 Z
18
+ date: 2011-08-16 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: activesupport
@@ -25,12 +25,12 @@ dependencies:
25
25
  requirements:
26
26
  - - "="
27
27
  - !ruby/object:Gem::Version
28
- hash: 27
28
+ hash: 31
29
29
  segments:
30
30
  - 2
31
31
  - 3
32
- - 12
33
- version: 2.3.12
32
+ - 14
33
+ version: 2.3.14
34
34
  type: :runtime
35
35
  version_requirements: *id001
36
36
  description: Implements the ActiveRecord pattern (Fowler, PoEAA) for ORM. It ties database tables and classes together for business objects, like Customer or Subscription, that can find, save, and destroy themselves without resorting to manual SQL.
@@ -238,8 +238,6 @@ files:
238
238
  - test/fixtures/edges.yml
239
239
  - test/fixtures/entrants.yml
240
240
  - test/fixtures/faces.yml
241
- - test/fixtures/fixture_database.sqlite3
242
- - test/fixtures/fixture_database_2.sqlite3
243
241
  - test/fixtures/fk_test_has_fk.yml
244
242
  - test/fixtures/fk_test_has_pk.yml
245
243
  - test/fixtures/funny_jokes.yml
@@ -428,7 +426,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
428
426
  requirements: []
429
427
 
430
428
  rubyforge_project: activerecord
431
- rubygems_version: 1.8.2
429
+ rubygems_version: 1.8.8
432
430
  signing_key:
433
431
  specification_version: 3
434
432
  summary: Implements the ActiveRecord pattern for ORM.