Skip to content

Commit

Permalink
Fix standardrb violations (#482)
Browse files Browse the repository at this point in the history
Co-authored-by: sarahraqueld <[email protected]>
  • Loading branch information
sarahraqueld and sarahraqueld authored Nov 11, 2024
1 parent 8a59436 commit d08be42
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions spec/support/macros/define_constant.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ def define_class(path, base = Object, &block)
const
end

def define_model(name, columns = {}, &block)
model = define_class(name, ActiveRecord::Base, &block)
def define_model(name, columns = {}, &)
model = define_class(name, ActiveRecord::Base, &)
create_table(model.table_name) do |table|
columns.each do |column_name, type|
table.column column_name, type
Expand All @@ -17,12 +17,12 @@ def define_model(name, columns = {}, &block)
model
end

def create_table(table_name, &block)
def create_table(table_name, &)
connection = ActiveRecord::Base.connection

begin
connection.execute("DROP TABLE IF EXISTS #{table_name}")
connection.create_table(table_name, &block)
connection.create_table(table_name, &)
created_tables << table_name
connection
rescue Exception => e # rubocop:disable Lint/RescueException
Expand Down

0 comments on commit d08be42

Please sign in to comment.