Skip to content

Commit 59ca056

Browse files
authored
Merge pull request #26 from workgena/rails-5.1-compatibility
Rails 5.1 compatibility
2 parents 77f1dac + 848a5ca commit 59ca056

File tree

6 files changed

+25
-17
lines changed

6 files changed

+25
-17
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@
1010
/.idea
1111
.DS_Store
1212
/spec/rails
13+
.versions.conf

.travis.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
script: bundle exec rspec spec
22
rvm:
3-
- 2.1.10
4-
- 2.2.6
5-
- 2.3.3
3+
- 2.2.7
4+
- 2.3.4
65
before_install:
76
- gem install bundler -v '= 1.9.3'
87
- gem update --system

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
## ActiveAdmin Scoped Collection Actions 0.3.3 (July 17, 2017) ##
2+
3+
* Fixed compatibility with Rails 5.1
4+
5+
6+
## ActiveAdmin Scoped Collection Actions 0.3.2 (July 17, 2017) ##
7+
8+
* Added I18n support.
9+
10+
translations for English and Spanish (@cpfarher #25).
11+
12+
*Christian Pfarher*
13+

Gemfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ source 'https://rubygems.org'
44
gemspec
55
group :test do
66
gem 'sprockets-rails', '2.3.3'
7-
gem 'rails', '4.2.0'
7+
gem 'rails', '~> 5.1'
88
gem 'rspec-rails'
9-
gem 'activeadmin', github: 'activeadmin', ref: '64b5295571400c461376cf060dae9522731fe6d9'
9+
gem 'activeadmin', '1.0.0'
1010
gem 'sass-rails'
1111
gem 'sqlite3'
1212
gem 'launchy'

lib/active_admin_scoped_collection_actions/dsl.rb

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@ module DSL
33

44
def scoped_collection_action(name, options = {}, &block)
55
if name == :scoped_collection_destroy
6-
7-
8-
96
options[:title] = I18n.t('active_admin_scoped_collection_actions.actions.delete') if options[:title].nil?
107
add_scoped_collection_action_default_destroy(options, &block)
118
elsif name == :scoped_collection_update
@@ -18,15 +15,14 @@ def scoped_collection_action(name, options = {}, &block)
1815
config.add_scoped_collection_action(name, options)
1916
end
2017

21-
2218
def add_scoped_collection_action_default_update(options, &block)
2319
batch_action :scoped_collection_update, if: proc { false } do
2420
unless authorized?(:batch_edit, resource_class)
2521
flash[:error] = I18n.t('active_admin_scoped_collection_actions.actions.no_permissions_msg')
26-
render nothing: true, status: :no_content and next
22+
head :ok and next
2723
end
2824
if !params.has_key?(:changes) || params[:changes].empty?
29-
render nothing: true, status: :no_content and next
25+
head :ok and next
3026
end
3127
permitted_changes = params.require(:changes).permit(*(options[:form].call.keys))
3228
if block_given?
@@ -43,17 +39,16 @@ def add_scoped_collection_action_default_update(options, &block)
4339
else
4440
flash[:error] = errors.join(". ")
4541
end
46-
render nothing: true, status: :no_content
42+
head :ok
4743
end
4844
end
4945
end
5046

51-
5247
def add_scoped_collection_action_default_destroy(_, &block)
5348
batch_action :scoped_collection_destroy, if: proc { false } do |_|
5449
unless authorized?(:batch_destroy, resource_class)
5550
flash[:error] = I18n.t('active_admin_scoped_collection_actions.actions.no_permissions_msg')
56-
render nothing: true, status: :no_content and next
51+
head :ok and next
5752
end
5853
if block_given?
5954
instance_eval &block
@@ -69,11 +64,11 @@ def add_scoped_collection_action_default_destroy(_, &block)
6964
else
7065
flash[:error] = errors.join(". ")
7166
end
72-
render nothing: true, status: :no_content
67+
head :ok
7368
end
7469
end
7570
end
7671

77-
7872
end
7973
end
74+
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module ActiveAdminScopedCollectionActions
2-
VERSION = "0.3.2"
2+
VERSION = "0.3.3"
33
end

0 commit comments

Comments
 (0)