diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2010-10-21 11:26:16 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2010-10-26 13:44:11 -0700 |
commit | 9d9aed433bd29eefb14807c02050cb8b88f15f0e (patch) | |
tree | f437803fdac6f0e11075ee77208655e9304e3da9 /activerecord/lib | |
parent | 1741bbe2d5cb58af76fb2ca31a25c05eadfadb71 (diff) | |
download | rails-9d9aed433bd29eefb14807c02050cb8b88f15f0e.tar.gz rails-9d9aed433bd29eefb14807c02050cb8b88f15f0e.tar.bz2 rails-9d9aed433bd29eefb14807c02050cb8b88f15f0e.zip |
add a session authorization setter to the pg connection
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb index 64a07cccca..e785cc6fea 100644 --- a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb @@ -389,6 +389,11 @@ module ActiveRecord end end + # Set the authorized user for this session + def session_auth=(user) + exec "SET SESSION AUTHORIZATION #{user}" + end + # REFERENTIAL INTEGRITY ==================================== def supports_disable_referential_integrity?() #:nodoc: |