diff --git a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb index 852debcdde..2f01fbb829 100644 --- a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb @@ -1239,7 +1239,7 @@ module ActiveRecord if match_data rest = name[match_data[0].length, name.length] rest = rest[1, rest.length] if rest.start_with? "." - [match_data[1], (rest.any? ? rest : nil)] + [match_data[1], (rest.length > 0 ? rest : nil)] end end