Skip to content

Commit 7a8a000

Browse files
authored
Merge pull request #45 from alexplatteeuw/bump_activeadmin_3
Add support for Active Admin 3.0
2 parents c42cb24 + f8e4c4e commit 7a8a000

File tree

5 files changed

+34
-2
lines changed

5 files changed

+34
-2
lines changed

.github/workflows/tests.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ jobs:
2323
include:
2424
- ruby-version: '3.0'
2525
gemfile: gemfiles/rails_6.x_active_admin_2.x.gemfile
26+
- ruby-version: '3.0'
27+
gemfile: gemfiles/rails_6.x_active_admin_3.x.gemfile
2628

2729
env:
2830
BUNDLE_GEMFILE: ${{ matrix.gemfile }}

Appraisals

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,9 @@ end
1616
appraise 'rails-6.x-active-admin-2.x' do
1717
gem 'rails', '~> 6.1'
1818
gem 'activeadmin', '~> 2.0'
19-
end
19+
end
20+
21+
appraise 'rails-6.x-active-admin-3.x' do
22+
gem 'rails', '~> 6.1'
23+
gem 'activeadmin', '~> 3.0'
24+
end

activeadmin-searchable_select.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Gem::Specification.new do |spec|
3535
spec.add_development_dependency 'semmy', '~> 1.0'
3636
spec.add_development_dependency 'sprockets', '~> 3.7'
3737

38-
spec.add_runtime_dependency 'activeadmin', ['>= 1.x', '< 3']
38+
spec.add_runtime_dependency 'activeadmin', ['>= 1.x', '< 4']
3939
spec.add_runtime_dependency 'jquery-rails', ['>= 3.0', '< 5']
4040
spec.add_runtime_dependency 'select2-rails', '~> 4.0'
4141
end
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# This file was generated by Appraisal
2+
3+
source "https://rubygems.org"
4+
5+
gem "sass-rails"
6+
gem "rails", "~> 6.1"
7+
gem "activeadmin", "~> 3.0"
8+
9+
gemspec path: "../"

spec/support/models.rb

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,21 @@ class User < ActiveRecord::Base; end
44

55
class Category < ActiveRecord::Base
66
belongs_to :created_by, class_name: 'User'
7+
8+
def self.ransackable_attributes(_auth_object = nil)
9+
['name']
10+
end
711
end
812

913
class Post < ActiveRecord::Base
1014
belongs_to :category
1115
belongs_to :user
1216

1317
scope(:published, -> { where(published: true) })
18+
19+
def self.ransackable_attributes(_auth_object = nil)
20+
%w(category_id title)
21+
end
1422
end
1523

1624
module RGB
@@ -24,13 +32,21 @@ module Internal
2432
class TagName < ActiveRecord::Base
2533
self.table_name = :internal_tag_names
2634
belongs_to :color, class_name: 'RGB::Color', foreign_key: :color_id
35+
36+
def self.ransackable_attributes(_auth_object = nil)
37+
['color_id']
38+
end
2739
end
2840
end
2941

3042
class OptionType < ActiveRecord::Base; end
3143

3244
class OptionValue < ActiveRecord::Base
3345
belongs_to :option_type
46+
47+
def self.ransackable_attributes(_auth_object = nil)
48+
['value']
49+
end
3450
end
3551

3652
class Product < ActiveRecord::Base

0 commit comments

Comments
 (0)