aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
diff options
context:
space:
mode:
authorGeorge Deglin <george@deglin.com>2015-09-20 22:32:26 -0700
committerGeorge Deglin <george@deglin.com>2015-09-20 23:19:59 -0700
commit871f45347778856feedf4b99c599e8acabc87ab6 (patch)
treeeb10137d4e4adbc3276eee50dff764efaf1194f7 /activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
parentc2c7cea13ae8b5eb2e96b194cc9c141784ea1f36 (diff)
downloadrails-871f45347778856feedf4b99c599e8acabc87ab6.tar.gz
rails-871f45347778856feedf4b99c599e8acabc87ab6.tar.bz2
rails-871f45347778856feedf4b99c599e8acabc87ab6.zip
Fix a bug with returning_disabled when using the postgresql adapter
The returning_disabled configuration option is required to make postgresql partitioning triggers work. This commit fixes a bug where an invalid query would be made in cases where returning_disabled was true and objects were created with no attributes defined.
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb')
-rw-r--r--activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb2
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 9de79a614c..25dfda9ef8 100644
--- a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
+++ b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
@@ -761,7 +761,7 @@ module ActiveRecord
end
def extract_table_ref_from_insert_sql(sql) # :nodoc:
- sql[/into\s+([^\(]*).*values\s*\(/im]
+ sql[/into\s("[A-Za-z0-9_."\[\]\s]+"|[A-Za-z0-9_."\[\]]+)\s*/im]
$1.strip if $1
end