Skip to content

Commit

Permalink
Avoids ActiveRecord deprecation warning.
Browse files Browse the repository at this point in the history
- removes database user, to run out of the box
  • Loading branch information
LeFnord committed Oct 30, 2023
1 parent ac268b2 commit 2ade776
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
4 changes: 2 additions & 2 deletions lib/starter/builder/active_record.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@ def initialize(app)
def call(env)
response = @app.call(env)
response[2] = ::Rack::BodyProxy.new(response[2]) do
ActiveRecord::Base.clear_active_connections!
ActiveRecord::Base.connection_handler.clear_active_connections!
end
return response
rescue StandardError
ActiveRecord::Base.clear_active_connections!
ActiveRecord::Base.connection_handler.clear_active_connections!
raise
end
end
Expand Down
3 changes: 0 additions & 3 deletions lib/starter/orms.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,21 +36,18 @@ def config
adapter: #{adapter}
encoding: unicode
timeout: 5000
user: postgres
database: #{@name}_development
test:
adapter: #{adapter}
encoding: unicode
timeout: 5000
user: postgres
database: #{@name}_test
production:
adapter: #{adapter}
encoding: unicode
timeout: 5000
user: postgres
database: #{@name}_production
FILE
end
Expand Down

0 comments on commit 2ade776

Please sign in to comment.