activeadmin 0.5.0.pre → 0.5.0.pre1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of activeadmin might be problematic. Click here for more details.
@@ -61,11 +61,11 @@ module ActiveAdmin
|
|
61
61
|
def add_default_batch_actions
|
62
62
|
destroy_options = {
|
63
63
|
:priority => 100,
|
64
|
-
:confirm => I18n.t('active_admin.batch_actions.delete_confirmation', :plural_model => plural_resource_label.downcase),
|
64
|
+
:confirm => proc { I18n.t('active_admin.batch_actions.delete_confirmation', :plural_model => active_admin_config.plural_resource_label.downcase) },
|
65
65
|
:if => proc{ controller.action_methods.include?('destroy') }
|
66
66
|
}
|
67
67
|
|
68
|
-
add_batch_action :destroy, I18n.t('active_admin.delete'), destroy_options do |selected_ids|
|
68
|
+
add_batch_action :destroy, proc { I18n.t('active_admin.delete') }, destroy_options do |selected_ids|
|
69
69
|
active_admin_config.resource_class.find(selected_ids).each { |r| r.destroy }
|
70
70
|
|
71
71
|
redirect_to collection_path, :notice => I18n.t("active_admin.batch_actions.succesfully_destroyed",
|
@@ -27,13 +27,16 @@ module ActiveAdmin
|
|
27
27
|
:id => "batch_actions_selector",
|
28
28
|
:button => { :class => "disabled" } do
|
29
29
|
batch_actions_to_display.each do |batch_action|
|
30
|
+
confirmation_text = render_or_call_method_or_proc_on(self, batch_action.confirm)
|
31
|
+
|
30
32
|
options = {
|
31
33
|
:class => "batch_action",
|
32
34
|
"data-action" => batch_action.sym,
|
33
|
-
"data-confirm" =>
|
35
|
+
"data-confirm" => confirmation_text
|
34
36
|
}
|
35
37
|
|
36
|
-
|
38
|
+
default_title = render_or_call_method_or_proc_on(self, batch_action.title)
|
39
|
+
title = I18n.t("active_admin.batch_actions.labels.#{batch_action.sym}", :default => default_title)
|
37
40
|
label = I18n.t("active_admin.batch_actions.action_label", :title => title)
|
38
41
|
|
39
42
|
item label, "#", options
|
data/lib/active_admin/version.rb
CHANGED
@@ -35,14 +35,24 @@ module ActiveAdmin
|
|
35
35
|
|
36
36
|
def add_default_user_to_migration
|
37
37
|
# Don't assume that we have a migration!
|
38
|
-
|
39
|
-
if
|
40
|
-
|
38
|
+
devise_migration_file = Dir["db/migrate/*_devise_create_#{table_name}.rb"].first
|
39
|
+
return if devise_migration_file.nil?
|
40
|
+
|
41
|
+
devise_migration_content = File.read(devise_migration_file)
|
42
|
+
|
43
|
+
if devise_migration_content["def change"]
|
44
|
+
inject_into_file devise_migration_file,
|
41
45
|
"def migrate(direction)\n super\n # Create a default user\n AdminUser.create!(:email => 'admin@example.com', :password => 'password', :password_confirmation => 'password') if direction == :up\n end\n\n ",
|
42
46
|
:before => "def change"
|
47
|
+
elsif devise_migration_content[/def (self.)?up/]
|
48
|
+
inject_into_file devise_migration_file,
|
49
|
+
"# Create a default user\n #{class_name}.create!(:email => 'admin@example.com', :password => 'password', :password_confirmation => 'password')\n\n ",
|
50
|
+
:before => "add_index :#{table_name}, :email"
|
51
|
+
else
|
52
|
+
puts devise_migration_content
|
53
|
+
raise "Failed to add default admin user to migration."
|
43
54
|
end
|
44
55
|
end
|
45
|
-
|
46
56
|
end
|
47
57
|
end
|
48
58
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activeadmin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.0.
|
4
|
+
version: 0.5.0.pre1
|
5
5
|
prerelease: 6
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,7 +13,7 @@ date: 2012-08-31 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
16
|
-
requirement: &
|
16
|
+
requirement: &70133835008040 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: 3.0.0
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70133835008040
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: jquery-rails
|
27
|
-
requirement: &
|
27
|
+
requirement: &70133835006600 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: 1.0.0
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70133835006600
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: bourbon
|
38
|
-
requirement: &
|
38
|
+
requirement: &70133835020700 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: 1.0.0
|
44
44
|
type: :runtime
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *70133835020700
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: meta_search
|
49
|
-
requirement: &
|
49
|
+
requirement: &70133835018280 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ! '>='
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: 0.9.2
|
55
55
|
type: :runtime
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *70133835018280
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: devise
|
60
|
-
requirement: &
|
60
|
+
requirement: &70133835016380 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ! '>='
|
@@ -65,10 +65,10 @@ dependencies:
|
|
65
65
|
version: 1.1.2
|
66
66
|
type: :runtime
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *70133835016380
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: formtastic
|
71
|
-
requirement: &
|
71
|
+
requirement: &70133835030680 !ruby/object:Gem::Requirement
|
72
72
|
none: false
|
73
73
|
requirements:
|
74
74
|
- - ! '>='
|
@@ -76,10 +76,10 @@ dependencies:
|
|
76
76
|
version: 2.0.0
|
77
77
|
type: :runtime
|
78
78
|
prerelease: false
|
79
|
-
version_requirements: *
|
79
|
+
version_requirements: *70133835030680
|
80
80
|
- !ruby/object:Gem::Dependency
|
81
81
|
name: inherited_resources
|
82
|
-
requirement: &
|
82
|
+
requirement: &70133835029980 !ruby/object:Gem::Requirement
|
83
83
|
none: false
|
84
84
|
requirements:
|
85
85
|
- - ! '>='
|
@@ -87,10 +87,10 @@ dependencies:
|
|
87
87
|
version: 1.3.1
|
88
88
|
type: :runtime
|
89
89
|
prerelease: false
|
90
|
-
version_requirements: *
|
90
|
+
version_requirements: *70133835029980
|
91
91
|
- !ruby/object:Gem::Dependency
|
92
92
|
name: kaminari
|
93
|
-
requirement: &
|
93
|
+
requirement: &70133835028700 !ruby/object:Gem::Requirement
|
94
94
|
none: false
|
95
95
|
requirements:
|
96
96
|
- - ! '>='
|
@@ -98,10 +98,10 @@ dependencies:
|
|
98
98
|
version: 0.13.0
|
99
99
|
type: :runtime
|
100
100
|
prerelease: false
|
101
|
-
version_requirements: *
|
101
|
+
version_requirements: *70133835028700
|
102
102
|
- !ruby/object:Gem::Dependency
|
103
103
|
name: sass
|
104
|
-
requirement: &
|
104
|
+
requirement: &70133835027420 !ruby/object:Gem::Requirement
|
105
105
|
none: false
|
106
106
|
requirements:
|
107
107
|
- - ! '>='
|
@@ -109,10 +109,10 @@ dependencies:
|
|
109
109
|
version: 3.1.0
|
110
110
|
type: :runtime
|
111
111
|
prerelease: false
|
112
|
-
version_requirements: *
|
112
|
+
version_requirements: *70133835027420
|
113
113
|
- !ruby/object:Gem::Dependency
|
114
114
|
name: fastercsv
|
115
|
-
requirement: &
|
115
|
+
requirement: &70133835026260 !ruby/object:Gem::Requirement
|
116
116
|
none: false
|
117
117
|
requirements:
|
118
118
|
- - ! '>='
|
@@ -120,10 +120,10 @@ dependencies:
|
|
120
120
|
version: '0'
|
121
121
|
type: :runtime
|
122
122
|
prerelease: false
|
123
|
-
version_requirements: *
|
123
|
+
version_requirements: *70133835026260
|
124
124
|
- !ruby/object:Gem::Dependency
|
125
125
|
name: arbre
|
126
|
-
requirement: &
|
126
|
+
requirement: &70133835025440 !ruby/object:Gem::Requirement
|
127
127
|
none: false
|
128
128
|
requirements:
|
129
129
|
- - ! '>='
|
@@ -131,7 +131,7 @@ dependencies:
|
|
131
131
|
version: 1.0.1
|
132
132
|
type: :runtime
|
133
133
|
prerelease: false
|
134
|
-
version_requirements: *
|
134
|
+
version_requirements: *70133835025440
|
135
135
|
description: The administration framework for Ruby on Rails.
|
136
136
|
email:
|
137
137
|
- gregdbell@gmail.com
|
@@ -611,7 +611,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
611
611
|
version: '0'
|
612
612
|
segments:
|
613
613
|
- 0
|
614
|
-
hash:
|
614
|
+
hash: 2086761120614959852
|
615
615
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
616
616
|
none: false
|
617
617
|
requirements:
|