Skip to content

Commit

Permalink
Possible jruby post gres fix
Browse files Browse the repository at this point in the history
strip leading and trailing quotes from default_sequence_name override for Postgre adapter.
  • Loading branch information
mrpasquini committed May 14, 2024
1 parent 8d4dfd4 commit c8fb3fb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions lib/apartment/active_record/postgresql_adapter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
module Apartment::PostgreSqlAdapterPatch
def default_sequence_name(table, _column)
res = super
res.delete!('"') # if rescued in super_method, trim leading and trailing quotes

schema_prefix = "#{Apartment::Tenant.current}."
default_tenant_prefix = "#{Apartment::Tenant.default_tenant}."

Expand Down
2 changes: 1 addition & 1 deletion spec/support/apartment_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def drop_schema(schema)
end

# Use this if you don't want to import schema.rb etc... but need the postgres schema to exist
# basically for speed purposes
# basically for speed purposes.
def create_schema(schema)
ActiveRecord::Base.connection.execute("CREATE SCHEMA #{schema}")
end
Expand Down

0 comments on commit c8fb3fb

Please sign in to comment.