aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record
diff options
context:
space:
mode:
authorSantiago Pastorino <santiago@wyeworks.com>2012-04-04 10:43:24 -0700
committerSantiago Pastorino <santiago@wyeworks.com>2012-04-04 10:43:24 -0700
commita9398a7da4fa845a0182bd53273c607dae55b1ee (patch)
treed3b3f2f95a45ce19f10b774d6d07b41b318afa99 /activerecord/lib/active_record
parentc6bd8a9d3ac2ebd5d0af4573d6d799085ac2219b (diff)
parent2d8396fc9fbea9189e9e945e41e643925da5b2cb (diff)
downloadrails-a9398a7da4fa845a0182bd53273c607dae55b1ee.tar.gz
rails-a9398a7da4fa845a0182bd53273c607dae55b1ee.tar.bz2
rails-a9398a7da4fa845a0182bd53273c607dae55b1ee.zip
Merge pull request #5716 from jurriaan/tr-gsub-cleanup
Updated/changed unneeded tr/gsubs
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r--activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb2
-rw-r--r--activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb4
2 files changed, 3 insertions, 3 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb b/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb
index 8b9e830040..0784b2d11a 100644
--- a/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb
+++ b/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb
@@ -16,7 +16,7 @@ module ActiveRecord
# Truncates a table alias according to the limits of the current adapter.
def table_alias_for(table_name)
- table_name[0...table_alias_length].gsub(/\./, '_')
+ table_name[0...table_alias_length].tr('.', '_')
end
# Checks to see if the table +table_name+ exists on the database.
diff --git a/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb b/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb
index 3d8dfab05c..91e1482ffd 100644
--- a/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb
+++ b/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb
@@ -339,9 +339,9 @@ module ActiveRecord
when /^null$/i
field["dflt_value"] = nil
when /^'(.*)'$/
- field["dflt_value"] = $1.gsub(/''/, "'")
+ field["dflt_value"] = $1.gsub("''", "'")
when /^"(.*)"$/
- field["dflt_value"] = $1.gsub(/""/, '"')
+ field["dflt_value"] = $1.gsub('""', '"')
end
SQLiteColumn.new(field['name'], field['dflt_value'], field['type'], field['notnull'].to_i == 0)