diff options
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb | 2 | ||||
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb | 4 |
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) |