Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/brendon/acts_as_list
Browse files Browse the repository at this point in the history
  • Loading branch information
brendon committed Mar 4, 2024
2 parents f1f4d39 + eef7603 commit 789c147
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ jobs:
BUNDLE_GEMFILE: ${{ matrix.gemfile }}
DB: ${{ matrix.db }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
Expand Down
4 changes: 4 additions & 0 deletions Appraisals
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,7 @@ end
appraise "rails-7-0" do
gem "activerecord", "~> 7.0.0"
end

appraise "rails-7-1" do
gem "activerecord", "~> 7.1.0"
end
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ When using PostgreSQL, it is also possible to leave this migration up to the dat
ROW_NUMBER() OVER (
PARTITION BY todo_list_id
ORDER BY updated_at
) as new_position
) AS new_position
FROM todo_items
) AS mapping
WHERE todo_items.id = mapping.id;
Expand Down Expand Up @@ -200,7 +200,7 @@ class TodoItem < ActiveRecord::Base
end

class TodoAttachment < ActiveRecord::Base
belongs_to :todo_list
belongs_to :todo_item
acts_as_list scope: :todo_item
end

Expand Down
2 changes: 1 addition & 1 deletion acts_as_list.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Gem::Specification.new do |s|
s.platform = Gem::Platform::RUBY
s.authors = ["Swanand Pagnis", "Brendon Muir"]
s.email = %w(swanand.pagnis@gmail.com brendon@spikeatschool.co.nz)
s.homepage = "http://github.com/brendon/acts_as_list"
s.homepage = "https://github.com/brendon/acts_as_list"
s.summary = "A gem adding sorting, reordering capabilities to an active_record model, allowing it to act as a list"
s.description = 'This "acts_as" extension provides the capabilities for sorting and reordering a number of objects in a list. The class that has this specified needs to have a "position" column defined as an integer on the mapped database table.'
s.license = "MIT"
Expand Down
14 changes: 11 additions & 3 deletions test/helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ def assert_equal_or_nil(a, b)
end

def assert_no_deprecation_warning_raised_by(failure_message = 'ActiveRecord deprecation warning raised when we didn\'t expect it', pass_message = 'No ActiveRecord deprecation raised')
original_behavior = ActiveSupport::Deprecation.behavior
ActiveSupport::Deprecation.behavior = :raise
original_behavior = active_record_deprecator.behavior
active_record_deprecator.behavior = :raise
begin
yield
rescue ActiveSupport::DeprecationException => e
Expand All @@ -65,5 +65,13 @@ def assert_no_deprecation_warning_raised_by(failure_message = 'ActiveRecord depr
pass pass_message
end
ensure
ActiveSupport::Deprecation.behavior = original_behavior
active_record_deprecator.behavior = original_behavior
end

def active_record_deprecator
if ActiveRecord::VERSION::MAJOR == 7 && ActiveRecord::VERSION::MINOR >= 1 || ActiveRecord::VERSION::MAJOR > 7
ActiveRecord.deprecator
else
ActiveSupport::Deprecation
end
end

0 comments on commit 789c147

Please sign in to comment.