Skip to content

Commit

Permalink
Merge pull request #108 from ifad/feature/ruby-3
Browse files Browse the repository at this point in the history
Feature/ruby 3
  • Loading branch information
vjt authored Jan 15, 2021
2 parents 863cc88 + 42dab36 commit 5671f80
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
7 changes: 7 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ rvm:
- 2.5
- 2.6
- 2.7
- 3.0

gemfile:
- gemfiles/rails_5.0.gemfile
Expand All @@ -32,6 +33,12 @@ jobs:
gemfile: gemfiles/rails_5.1.gemfile
- rvm: 2.7
gemfile: gemfiles/rails_5.2.gemfile
- rvm: 3.0
gemfile: gemfiles/rails_5.0.gemfile
- rvm: 3.0
gemfile: gemfiles/rails_5.1.gemfile
- rvm: 3.0
gemfile: gemfiles/rails_5.2.gemfile

addons:
postgresql: "12"
Expand Down
8 changes: 4 additions & 4 deletions lib/chrono_model/adapter/migrations.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module Migrations
# Creates the given table, possibly creating the temporal schema
# objects if the `:temporal` option is given and set to true.
#
def create_table(table_name, options = {})
def create_table(table_name, **options)
# No temporal features requested, skip
return super unless options[:temporal]

Expand Down Expand Up @@ -63,7 +63,7 @@ def rename_table(name, new_name)
# features on the given table. Please note that you'll lose your history
# when demoting a temporal table to a plain one.
#
def change_table(table_name, options = {}, &block)
def change_table(table_name, **options, &block)
transaction do

# Add an empty proc to support calling change_table without a block.
Expand All @@ -76,15 +76,15 @@ def change_table(table_name, options = {}, &block)
end

drop_and_recreate_public_view(table_name, options) do
super table_name, options, &block
super table_name, **options, &block
end

else
if is_chrono?(table_name)
chrono_undo_temporal_table(table_name)
end

super table_name, options, &block
super table_name, **options, &block
end

end
Expand Down

0 comments on commit 5671f80

Please sign in to comment.