Skip to content

Commit

Permalink
Update rails to 7.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Taucher2003 committed Sep 21, 2024
1 parent 9a57577 commit 48aca9f
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 8 deletions.
8 changes: 8 additions & 0 deletions bin/rubocop
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env ruby
require "rubygems"
require "bundler/setup"

# explicit rubocop config increases performance slightly while avoiding config confusion.
ARGV.unshift("--config", File.expand_path("../.rubocop.yml", __dir__))

load Gem.bin_path("rubocop", "rubocop")
2 changes: 1 addition & 1 deletion config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
module Sagittarius
class Application < Rails::Application
# Initialize configuration defaults for originally generated Rails version.
config.load_defaults 7.1
config.load_defaults 7.2

# Use SQL instead of Active Record's schema dumper when creating the database.
# This is necessary if your schema can't be completely dumped by the schema dumper,
Expand Down
2 changes: 1 addition & 1 deletion config/initializers/filter_parameter_logging.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
# Use this to limit dissemination of sensitive information.
# See the ActiveSupport::ParameterFilter documentation for supported notations and behaviors.
Rails.application.config.filter_parameters += %i[
passw secret token _key crypt salt certificate otp ssn query variables
passw email secret token _key crypt salt certificate otp ssn query variables
]
2 changes: 1 addition & 1 deletion config/sagittarius.example.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
rails:
threads: 5
threads: 3
web:
port: 3000
force_ssl:
Expand Down
2 changes: 1 addition & 1 deletion lib/sagittarius/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def self.application_setting_overrides
def self.defaults
{
rails: {
threads: 5,
threads: 3,
web: {
port: 3000,
force_ssl: nil,
Expand Down
4 changes: 2 additions & 2 deletions lib/sagittarius/database/schema_migrations/context.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ def schema_directory
end

def versions_to_create
versions_from_database = @connection.schema_migration.versions
versions_from_migration_files = @connection.migration_context.migrations.map { |m| m.version.to_s }
versions_from_database = @connection.pool.schema_migration.versions
versions_from_migration_files = @connection.pool.migration_context.migrations.map { |m| m.version.to_s }

versions_from_database & versions_from_migration_files
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@
describe '#versions_to_create' do
before do
# rubocop:disable RSpec/MessageChain -- we are mocking into active records structure
allow(connection).to receive_message_chain(:schema_migration, :versions).and_return(migrated_versions)
allow(connection.pool).to receive_message_chain(:schema_migration, :versions).and_return(migrated_versions)

migrations_struct = Struct.new(:version)
migrations = file_versions.map { |version| migrations_struct.new(version) }
allow(connection).to receive_message_chain(:migration_context, :migrations).and_return(migrations)
allow(connection.pool).to receive_message_chain(:migration_context, :migrations).and_return(migrations)
# rubocop:enable RSpec/MessageChain
end

Expand Down

0 comments on commit 48aca9f

Please sign in to comment.