diff options
author | Kuldeep Aggarwal <kd.engineer@yahoo.co.in> | 2013-12-19 18:46:17 +0530 |
---|---|---|
committer | Kuldeep Aggarwal <kd.engineer@yahoo.co.in> | 2013-12-19 18:46:17 +0530 |
commit | b082bece5ed99a1bb1ff9d4af5f9d97a3dcaf6c1 (patch) | |
tree | 3fac5e446c6f767fa154015ee704d334a5762f2c /activerecord/lib | |
parent | 3de199988fb6295ed7c37d50f9cbf4025dfca088 (diff) | |
download | rails-b082bece5ed99a1bb1ff9d4af5f9d97a3dcaf6c1.tar.gz rails-b082bece5ed99a1bb1ff9d4af5f9d97a3dcaf6c1.tar.bz2 rails-b082bece5ed99a1bb1ff9d4af5f9d97a3dcaf6c1.zip |
Fix PostgreSQL insert to properly extract table name from multiline string SQL.
Previously, executing an insert SQL in PostgreSQL with a command like this:
insert into articles(
number)
values(
5152
)
would not work because the adapter was unable to extract the correct articles table name.
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb index 2912a208ee..dd3bfa5546 100644 --- a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb @@ -969,7 +969,7 @@ module ActiveRecord end def extract_table_ref_from_insert_sql(sql) - sql[/into\s+([^\(]*).*values\s*\(/i] + sql[/into\s+([^\(]*).*values\s*\(/im] $1.strip if $1 end |