diff options
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters/postgresql/column.rb')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/postgresql/column.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/postgresql/column.rb b/activerecord/lib/active_record/connection_adapters/postgresql/column.rb index 0eb4fb468c..be13ead120 100644 --- a/activerecord/lib/active_record/connection_adapters/postgresql/column.rb +++ b/activerecord/lib/active_record/connection_adapters/postgresql/column.rb @@ -6,7 +6,9 @@ module ActiveRecord alias :array? :array def serial? - default_function && default_function =~ /\Anextval\(.*\)\z/ + return unless default_function + + %r{\Anextval\('(?<table_name>.+)_#{name}_seq'::regclass\)\z} === default_function end end end |