diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2008-06-11 09:06:36 -0700 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2008-06-11 09:06:36 -0700 |
commit | 23df8befcd557a3294b8a87cf68fd21b1a9d9a49 (patch) | |
tree | 0e3f6253be86b06c9a3a28f5d86f64851eb90561 /activerecord | |
parent | d0b3685a0e221b54fdf3c27326564950a419d823 (diff) | |
download | rails-23df8befcd557a3294b8a87cf68fd21b1a9d9a49.tar.gz rails-23df8befcd557a3294b8a87cf68fd21b1a9d9a49.tar.bz2 rails-23df8befcd557a3294b8a87cf68fd21b1a9d9a49.zip |
supports_insert_with_returning? caches false result also
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb index e759a74faf..294f4c1929 100644 --- a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb @@ -324,9 +324,12 @@ module ActiveRecord end def supports_insert_with_returning? - @supports_insert_with_returning ||= - @connection.respond_to?(:server_version) && - @connection.server_version >= 80200 + unless defined? @supports_insert_with_returning + @supports_insert_with_returning = + @connection.respond_to?(:server_version) && + @connection.server_version >= 80200 + end + @supports_insert_with_returning end # Returns the configured supported identifier length supported by PostgreSQL, |