Skip to content

Commit

Permalink
Fixes for ruby 3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
gsmetal committed Feb 7, 2024
1 parent 3002133 commit 097099f
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ PATH
remote: .
specs:
uuidable (1.0.rc1)
activerecord (>= 4.2, < 7.1)
activerecord (>= 4.2, < 7.2)
mysql-binuuid-rails (>= 1.3, < 2)
uuidtools (>= 2.1, < 3)

Expand Down Expand Up @@ -110,12 +110,12 @@ PLATFORMS
ruby

DEPENDENCIES
bundler (~> 1.11)
bundler (~> 2.4)
rake (~> 13.0)
rspec (~> 3.0)
rubocop
travis (~> 1.8, >= 1.8.2)
uuidable!

BUNDLED WITH
1.17.3
2.4.22
8 changes: 4 additions & 4 deletions lib/uuidable/migration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ def uuid(column_name = COLUMN_NAME, **opts)

column_name ||= opts.delete(:column_name)

column column_name, COLUMN_TYPE, COLUMN_OPTIONS.merge(opts)
index column_name, INDEX_OPTIONS.merge(index_opts) if index_opts
column column_name, COLUMN_TYPE, **COLUMN_OPTIONS.merge(opts)
index column_name, **INDEX_OPTIONS.merge(index_opts) if index_opts
end
end

Expand All @@ -27,15 +27,15 @@ def add_uuid_column(table_name, column_name = COLUMN_NAME, **opts)

column_name ||= opts.delete(:column_name)

add_column table_name, column_name, COLUMN_TYPE, COLUMN_OPTIONS.merge(opts)
add_column table_name, column_name, COLUMN_TYPE, **COLUMN_OPTIONS.merge(opts)

add_uuid_index(table_name, index_opts.merge(column_name: column_name)) if index_opts
end

def add_uuid_index(table_name, opts = {})
column_name = opts.delete(:column_name) || COLUMN_NAME

add_index table_name, column_name, INDEX_OPTIONS.merge(opts)
add_index table_name, column_name, **INDEX_OPTIONS.merge(opts)
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/uuidable/v1_migration_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module V1MigrationHelpers
def uuidable_migrate_uuid_columns_to_v1(table_name, **columns)
change_table table_name, bulk: true do |t|
columns.each do |column, options|
t.column :"#{column}_new", :binary, COLUMN_OPTIONS.merge(options).merge(after: column)
t.column :"#{column}_new", :binary, **COLUMN_OPTIONS.merge(options).merge(after: column)
end
end

Expand Down
4 changes: 2 additions & 2 deletions uuidable.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ Gem::Specification.new do |spec|

spec.required_ruby_version = '>= 2.7'

spec.add_development_dependency 'bundler', '~> 1.11'
spec.add_development_dependency 'bundler', '~> 2.4'
spec.add_development_dependency 'rake', '~> 13.0'
spec.add_development_dependency 'rspec', '~> 3.0'
spec.add_development_dependency 'travis', '~> 1.8', '>= 1.8.2'

spec.add_dependency 'activerecord', '>= 4.2', '< 7.1'
spec.add_dependency 'activerecord', '>= 4.2', '< 7.2'
spec.add_dependency 'mysql-binuuid-rails', '>= 1.3', '< 2'
spec.add_dependency 'uuidtools', '>= 2.1', '< 3'
end

0 comments on commit 097099f

Please sign in to comment.