Skip to content

Commit

Permalink
[#81] check for var existence before
Browse files Browse the repository at this point in the history
  • Loading branch information
rpbaltazar committed Jul 12, 2020
1 parent 6f7ecf2 commit 5251624
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/apartment/adapters/postgresql_adapter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,9 @@ def reset_sequence_names
.select { |c| c.instance_variable_defined?(:@sequence_name) }
.reject { |c| c.instance_variable_defined?(:@explicit_sequence_name) && c.instance_variable_get(:@explicit_sequence_name) }
.each do |c|
c.remove_instance_variable :@sequence_name
# NOTE: due to this https://github.com/rails-on-services/apartment/issues/81
# unreproduceable error we're checking before trying to remove it
c.remove_instance_variable :@sequence_name if c.instance_variable_defined?(:@sequence_name)
end
end
end
Expand Down

0 comments on commit 5251624

Please sign in to comment.