activeadmin 1.0.0.pre5 → 1.0.0

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.

Files changed (155) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +27 -0
  3. data/.travis.yml +21 -23
  4. data/Appraisals +12 -74
  5. data/CHANGELOG.md +21 -5
  6. data/CONTRIBUTING.md +2 -2
  7. data/Gemfile +8 -9
  8. data/README.md +19 -56
  9. data/Rakefile +1 -1
  10. data/activeadmin.gemspec +4 -4
  11. data/app/assets/stylesheets/active_admin/_forms.scss +10 -0
  12. data/config/locales/ca.yml +1 -1
  13. data/config/locales/da.yml +44 -12
  14. data/config/locales/el.yml +1 -1
  15. data/config/locales/en.yml +2 -0
  16. data/config/locales/fr.yml +16 -2
  17. data/config/locales/ja.yml +1 -0
  18. data/config/locales/zh-CN.yml +4 -0
  19. data/docs/12-arbre-components.md +23 -0
  20. data/docs/14-gotchas.md +1 -1
  21. data/docs/2-resource-customization.md +2 -5
  22. data/docs/5-forms.md +19 -0
  23. data/docs/6-show-pages.md +0 -28
  24. data/docs/9-batch-actions.md +0 -1
  25. data/docs/CNAME +1 -1
  26. data/docs/_includes/head.html +4 -4
  27. data/docs/_includes/toc.html +2 -1
  28. data/docs/documentation.md +2 -2
  29. data/docs/index.html +1 -6
  30. data/docs/stylesheets/main.css +172 -219
  31. data/features/belongs_to.feature +5 -5
  32. data/features/comments/commenting.feature +0 -13
  33. data/features/create_another.feature +55 -0
  34. data/features/development_reloading.feature +2 -4
  35. data/features/edit_page.feature +6 -7
  36. data/features/favicon.feature +2 -2
  37. data/features/i18n.feature +1 -0
  38. data/features/index/filters.feature +18 -0
  39. data/features/index/format_as_csv.feature +3 -3
  40. data/features/index/formats.feature +22 -0
  41. data/features/index/index_as_table.feature +6 -6
  42. data/features/index/page_title.feature +1 -2
  43. data/features/menu.feature +20 -1
  44. data/features/new_page.feature +6 -8
  45. data/features/registering_assets.feature +4 -4
  46. data/features/registering_pages.feature +18 -0
  47. data/features/renamed_resource.feature +2 -4
  48. data/features/show/page_title.feature +1 -2
  49. data/features/step_definitions/attribute_steps.rb +1 -1
  50. data/features/step_definitions/configuration_steps.rb +2 -2
  51. data/features/step_definitions/format_steps.rb +4 -0
  52. data/features/step_definitions/index_scope_steps.rb +1 -1
  53. data/features/step_definitions/menu_steps.rb +2 -2
  54. data/features/step_definitions/user_steps.rb +1 -1
  55. data/features/step_definitions/web_steps.rb +6 -5
  56. data/features/sti_resource.feature +2 -2
  57. data/features/strong_parameters.feature +0 -4
  58. data/features/support/env.rb +5 -19
  59. data/features/support/paths.rb +6 -9
  60. data/gemfiles/rails_42.gemfile +15 -23
  61. data/gemfiles/rails_50.gemfile +15 -16
  62. data/gemfiles/rails_51.gemfile +45 -0
  63. data/lib/active_admin/application.rb +4 -0
  64. data/lib/active_admin/base_controller.rb +2 -7
  65. data/lib/active_admin/base_controller/menu.rb +1 -5
  66. data/lib/active_admin/csv_builder.rb +2 -2
  67. data/lib/active_admin/dependency.rb +4 -8
  68. data/lib/active_admin/devise.rb +1 -1
  69. data/lib/active_admin/error.rb +1 -1
  70. data/lib/active_admin/filters/active.rb +2 -10
  71. data/lib/active_admin/filters/resource_extension.rb +1 -10
  72. data/lib/active_admin/inputs/filters/date_range_input.rb +1 -1
  73. data/lib/active_admin/inputs/filters/select_input.rb +1 -2
  74. data/lib/active_admin/inputs/filters/text_input.rb +2 -2
  75. data/lib/active_admin/menu.rb +1 -1
  76. data/lib/active_admin/namespace.rb +14 -7
  77. data/lib/active_admin/orm/active_record/comments.rb +2 -7
  78. data/lib/active_admin/orm/active_record/comments/comment.rb +2 -12
  79. data/lib/active_admin/page.rb +5 -0
  80. data/lib/active_admin/page_controller.rb +1 -5
  81. data/lib/active_admin/resource.rb +28 -5
  82. data/lib/active_admin/resource/attributes.rb +44 -0
  83. data/lib/active_admin/resource/menu.rb +4 -1
  84. data/lib/active_admin/resource/routes.rb +2 -3
  85. data/lib/active_admin/resource_controller.rb +13 -0
  86. data/lib/active_admin/resource_controller/data_access.rb +18 -9
  87. data/lib/active_admin/resource_dsl.rb +21 -18
  88. data/lib/active_admin/version.rb +1 -1
  89. data/lib/active_admin/view_helpers/breadcrumb_helper.rb +1 -1
  90. data/lib/active_admin/view_helpers/display_helper.rb +10 -12
  91. data/lib/active_admin/view_helpers/download_format_links_helper.rb +12 -0
  92. data/lib/active_admin/view_helpers/fields_for.rb +1 -2
  93. data/lib/active_admin/view_helpers/form_helper.rb +1 -1
  94. data/lib/active_admin/views/components/active_admin_form.rb +28 -2
  95. data/lib/active_admin/views/components/paginated_collection.rb +3 -8
  96. data/lib/active_admin/views/components/table_for.rb +1 -1
  97. data/lib/active_admin/views/index_as_table.rb +2 -2
  98. data/lib/active_admin/views/pages/layout.rb +1 -1
  99. data/lib/active_admin/views/pages/show.rb +1 -1
  100. data/lib/bug_report_templates/rails_5_master.rb +1 -3
  101. data/lib/generators/active_admin/devise/devise_generator.rb +1 -1
  102. data/lib/generators/active_admin/install/templates/active_admin.rb.erb +7 -0
  103. data/lib/generators/active_admin/install/templates/admin_user.rb.erb +0 -2
  104. data/lib/generators/active_admin/install/templates/migrations/create_active_admin_comments.rb.erb +5 -7
  105. data/lib/generators/active_admin/resource/resource_generator.rb +1 -1
  106. data/lib/generators/active_admin/resource/templates/{admin.rb → admin.rb.erb} +0 -2
  107. data/lib/ransack_ext.rb +2 -2
  108. data/spec/rails_helper.rb +1 -19
  109. data/spec/requests/default_namespace_spec.rb +40 -8
  110. data/spec/support/active_admin_integration_spec_helper.rb +9 -2
  111. data/spec/support/rails_template.rb +17 -20
  112. data/spec/support/rails_template_with_data.rb +3 -9
  113. data/spec/support/templates/admin/stores.rb +1 -3
  114. data/spec/unit/application_spec.rb +19 -8
  115. data/spec/unit/belongs_to_spec.rb +6 -2
  116. data/spec/unit/comments_spec.rb +0 -19
  117. data/spec/unit/controller_filters_spec.rb +5 -5
  118. data/spec/unit/csv_builder_spec.rb +7 -4
  119. data/spec/unit/filters/active_spec.rb +1 -8
  120. data/spec/unit/filters/filter_form_builder_spec.rb +2 -3
  121. data/spec/unit/filters/resource_spec.rb +3 -4
  122. data/spec/unit/form_builder_spec.rb +39 -11
  123. data/spec/unit/namespace/register_page_spec.rb +1 -1
  124. data/spec/unit/pretty_format_spec.rb +39 -35
  125. data/spec/unit/resource/attributes_spec.rb +50 -0
  126. data/spec/unit/resource/includes_spec.rb +1 -1
  127. data/spec/unit/resource/ordering_spec.rb +1 -1
  128. data/spec/unit/resource/routes_spec.rb +2 -2
  129. data/spec/unit/resource_controller/data_access_spec.rb +51 -10
  130. data/spec/unit/resource_controller/decorators_spec.rb +2 -2
  131. data/spec/unit/resource_controller/sidebars_spec.rb +3 -3
  132. data/spec/unit/resource_controller_spec.rb +16 -5
  133. data/spec/unit/resource_spec.rb +12 -38
  134. data/spec/unit/routing_spec.rb +2 -2
  135. data/spec/unit/view_helpers/breadcrumbs_spec.rb +36 -1
  136. data/spec/unit/view_helpers/display_helper_spec.rb +17 -2
  137. data/spec/unit/view_helpers/fields_for_spec.rb +1 -1
  138. data/spec/unit/view_helpers/form_helper_spec.rb +3 -3
  139. data/spec/unit/view_helpers/method_or_proc_helper_spec.rb +2 -2
  140. data/spec/unit/views/components/attributes_table_spec.rb +2 -2
  141. data/spec/unit/views/components/index_list_spec.rb +1 -1
  142. data/spec/unit/views/components/paginated_collection_spec.rb +4 -4
  143. data/spec/unit/views/components/table_for_spec.rb +1 -1
  144. data/spec/unit/views/components/unsupported_browser_spec.rb +1 -1
  145. data/spec/unit/views/pages/form_spec.rb +4 -1
  146. data/spec/unit/views/pages/index_spec.rb +1 -1
  147. data/spec/unit/views/pages/show_spec.rb +2 -3
  148. data/tasks/lint.rake +8 -0
  149. metadata +22 -29
  150. data/features/step_definitions/symbol_leak_steps.rb +0 -3
  151. data/features/symbol_leak.feature +0 -35
  152. data/gemfiles/rails_32.gemfile +0 -54
  153. data/gemfiles/rails_40.gemfile +0 -53
  154. data/gemfiles/rails_41.gemfile +0 -53
  155. data/spec/support/deferred_garbage_collection.rb +0 -19
@@ -1,6 +1,6 @@
1
1
  Then /^I should see the attribute "([^"]*)" with "([^"]*)"$/ do |title, value|
2
2
  elems = all ".attributes_table th:contains('#{title}') ~ td:contains('#{value}')"
3
- expect(elems.first).to_not eq(nil), 'attribute missing'
3
+ expect(elems.first).to_not eq(nil), "attribute missing"
4
4
  end
5
5
 
6
6
  Then /^I should see the attribute "([^"]*)" with a nicely formatted datetime$/ do |title|
@@ -30,7 +30,7 @@ module ActiveAdminContentsRollback
30
30
  # Else, remove the file and its parent folder structure until Rails.root OR other files exist.
31
31
  def rollback_file(file, contents)
32
32
  if contents.present?
33
- File.open(file,'w') { |f| f << contents }
33
+ File.open(file, 'w') { |f| f << contents }
34
34
  else
35
35
  File.delete(file)
36
36
  begin
@@ -87,7 +87,7 @@ Given /^"([^"]*)" contains:$/ do |filename, contents|
87
87
  FileUtils.mkdir_p File.dirname path
88
88
  record path
89
89
 
90
- File.open(path,'w+'){ |f| f << contents }
90
+ File.open(path, 'w+'){ |f| f << contents }
91
91
  end
92
92
 
93
93
  Given /^I add "([^"]*)" to the "([^"]*)" model$/ do |code, model_name|
@@ -50,3 +50,7 @@ end
50
50
  Then /^the encoding of the CSV file should be "([^"]*)"$/ do |text|
51
51
  expect(page.driver.response.body.encoding).to be Encoding.find(Encoding.aliases[text] || text)
52
52
  end
53
+
54
+ Then /^access denied$/ do
55
+ expect(page).to have_content(I18n.t("active_admin.access_denied.message"))
56
+ end
@@ -10,7 +10,7 @@ Then /^I should see the scope "([^"]*)" not selected$/ do |name|
10
10
  end
11
11
 
12
12
  Then /^I should see the scope "([^"]*)" with the count (\d+)$/ do |name, count|
13
- name = name.tr(' ','').underscore.downcase
13
+ name = name.tr(' ', '').underscore.downcase
14
14
  step %{I should see "#{count}" within ".scopes .#{name} .count"}
15
15
  end
16
16
 
@@ -1,9 +1,9 @@
1
1
  Then /^I should see a menu item for "([^"]*)"$/ do |name|
2
- expect(page).to have_css '#tabs li a', text: name
2
+ expect(page).to have_css '#tabs > li > a', text: name
3
3
  end
4
4
 
5
5
  Then /^I should not see a menu item for "([^"]*)"$/ do |name|
6
- expect(page).to_not have_css '#tabs li a', text: name
6
+ expect(page).to_not have_css '#tabs > li > a', text: name
7
7
  end
8
8
 
9
9
  Then /^I should see a nested menu item for "([^"]*)"$/ do |name|
@@ -42,7 +42,7 @@ end
42
42
 
43
43
  Given /^override locale "([^"]*)" with "([^"]*)"$/ do |path, value|
44
44
  keys_value = path.split('.') + [value]
45
- locale_hash = keys_value.reverse.inject{|a,n| {n=>a}}
45
+ locale_hash = keys_value.reverse.inject{|a, n| {n=>a}}
46
46
  I18n.available_locales
47
47
  I18n.backend.store_translations(I18n.locale, locale_hash)
48
48
  end
@@ -27,10 +27,6 @@ When /^(?:I )go to (.+)$/ do |page_name|
27
27
  visit path_to(page_name)
28
28
  end
29
29
 
30
- When /^(?:I )POST to "(.*?)" with params "(.*?)"$/ do |url, params|
31
- post "#{url}#{params}"
32
- end
33
-
34
30
  When /^(?:I )press "([^"]*)"$/ do |button|
35
31
  click_button(button)
36
32
  end
@@ -72,7 +68,12 @@ end
72
68
 
73
69
  Then /^the "([^"]*)" checkbox(?: within (.*))? should( not)? be checked$/ do |label, parent, negate|
74
70
  with_scope(parent) do
75
- expect(find_field(label)['checked']).to negate ? eq(false) : eq(true)
71
+ checkbox = find_field(label)
72
+ if negate
73
+ expect(checkbox).not_to be_checked
74
+ else
75
+ expect(checkbox).to be_checked
76
+ end
76
77
  end
77
78
  end
78
79
 
@@ -7,10 +7,10 @@ Feature: STI Resource
7
7
  And a configuration of:
8
8
  """
9
9
  ActiveAdmin.register Publisher do
10
- permit_params :first_name, :last_name, :username, :age if Rails::VERSION::MAJOR >= 4
10
+ permit_params :first_name, :last_name, :username, :age
11
11
  end
12
12
  ActiveAdmin.register User do
13
- permit_params :first_name, :last_name, :username, :age if Rails::VERSION::MAJOR >= 4
13
+ permit_params :first_name, :last_name, :username, :age
14
14
  end
15
15
  """
16
16
 
@@ -1,10 +1,6 @@
1
- @rails4
2
1
  @silent_unpermitted_params_failure
3
2
  Feature: Strong Params
4
3
 
5
- When I am using Rails 4
6
- I want to use Strong Parameters
7
-
8
4
  Background:
9
5
  Given a category named "Music" exists
10
6
  And a user named "John Doe" exists
@@ -103,33 +103,19 @@ Before do
103
103
  end
104
104
 
105
105
  # Force deprecations to raise an exception.
106
- # This would set `behavior = :raise`, but that wasn't added until Rails 4.
107
- ActiveSupport::Deprecation.behavior = -> message, callstack do
108
- e = StandardError.new message
109
- e.set_backtrace callstack.map(&:to_s)
110
- puts e # sometimes Cucumber otherwise won't show the error message
111
- raise e
112
- end
106
+ ActiveSupport::Deprecation.behavior = :raise
113
107
 
114
108
  # improve the performance of the specs suite by not logging anything
115
109
  # see http://blog.plataformatec.com.br/2011/12/three-tips-to-improve-the-performance-of-your-test-suite/
116
110
  Rails.logger.level = 4
117
111
 
118
- # Improves performance by forcing the garbage collector to run less often.
119
- unless ENV['DEFER_GC'] == '0' || ENV['DEFER_GC'] == 'false'
120
- require File.expand_path('../../../spec/support/deferred_garbage_collection', __FILE__)
121
- Before { DeferredGarbageCollection.start }
122
- After { DeferredGarbageCollection.reconsider }
123
- end
124
-
125
- # Don't run @rails4 tagged features for versions before Rails 4.
126
- Before('@rails4') do |scenario|
127
- scenario.skip_invoke! if Rails::VERSION::MAJOR < 4
128
- end
129
-
130
112
  Around '@silent_unpermitted_params_failure' do |scenario, block|
131
113
  original = ActionController::Parameters.action_on_unpermitted_parameters
132
114
  ActionController::Parameters.action_on_unpermitted_parameters = false
133
115
  block.call
134
116
  ActionController::Parameters.action_on_unpermitted_parameters = original
135
117
  end
118
+
119
+ Around '@locale_manipulation' do |scenario, block|
120
+ I18n.with_locale(:en) { block.call }
121
+ end
@@ -6,10 +6,7 @@ module NavigationHelpers
6
6
  # step definition in web_steps.rb
7
7
  #
8
8
  def path_to(page_name)
9
- params = page_name.scan(/with params "(.*?)"/).flatten[0] || ''
10
- page_name.sub! /\ with params.*/, ''
11
-
12
- url = case page_name
9
+ case page_name
13
10
 
14
11
  when /the home\s?page/
15
12
  '/'
@@ -19,12 +16,10 @@ module NavigationHelpers
19
16
  "/admin/posts/new"
20
17
  when /the login page/
21
18
  "/admin/login"
22
- when /the first post show page/
23
- "/admin/posts/1"
24
19
  when /the first post custom status page/
25
20
  "/admin/posts/1/status"
26
- when /the first post edit page/
27
- "/admin/posts/1/edit"
21
+ when /the last posts page/
22
+ "/admin/last_posts"
28
23
  when /the admin password reset form with token "([^"]*)"/
29
24
  "/admin/password/edit?reset_password_token=#{$1}"
30
25
 
@@ -41,6 +36,9 @@ module NavigationHelpers
41
36
  when /^the index page for (.*)$/
42
37
  send "admin_#{$1}_path"
43
38
 
39
+ when /^the (.*) index page for (.*)$/
40
+ send "admin_#{$2}_path", format: $1
41
+
44
42
  when /^the last author's posts$/
45
43
  admin_user_posts_path(User.last)
46
44
 
@@ -69,7 +67,6 @@ module NavigationHelpers
69
67
  "Now, go and add a mapping in #{__FILE__}"
70
68
  end
71
69
  end
72
- url + params
73
70
  end
74
71
  end
75
72
 
@@ -4,34 +4,33 @@ source "https://rubygems.org"
4
4
 
5
5
  gem "cancan"
6
6
  gem "pundit"
7
- gem "thor", "<= 0.19.1"
8
7
  gem "rake"
9
- gem "parallel_tests", "< 2.10"
8
+ gem "parallel_tests"
10
9
  gem "pry"
11
- gem "rails", "4.2.8.rc1"
10
+ gem "rubocop", "0.48.1"
11
+ gem "rails", "4.2.8"
12
12
  gem "jquery-ui-rails", "~> 5.0"
13
13
  gem "devise", "~> 3.5"
14
- gem "inherited_resources"
15
14
  gem "draper", "~> 2.1"
16
- gem "activerecord-jdbcsqlite3-adapter", :platforms => :jruby
15
+ gem "activerecord-jdbcsqlite3-adapter", platforms: :jruby
17
16
 
18
17
  group :development do
19
- gem "better_errors", :platforms => [:ruby_20, :ruby_21, :ruby_22, :ruby_23, :ruby_24]
20
- gem "binding_of_caller", :platforms => :mri
18
+ gem "better_errors"
19
+ gem "binding_of_caller", platforms: :mri
21
20
  gem "rack-mini-profiler"
22
21
  gem "yard"
23
- gem "redcarpet", :platforms => :mri
24
- gem "kramdown", :platforms => :jruby
25
- gem "appraisal", :require => false
22
+ gem "redcarpet", platforms: :mri
23
+ gem "kramdown", platforms: :jruby
24
+ gem "appraisal", "~> 2.2", require: false
26
25
  end
27
26
 
28
27
  group :test do
29
28
  gem "capybara"
30
- gem "simplecov", :require => false
31
- gem "codecov", :require => false
32
- gem "cucumber-rails", :require => false
29
+ gem "simplecov", require: false
30
+ gem "codecov", require: false
31
+ gem "cucumber-rails", require: false
33
32
  gem "cucumber", "1.3.20"
34
- gem "database_cleaner"
33
+ gem "database_cleaner", git: "https://github.com/DatabaseCleaner/database_cleaner.git"
35
34
  gem "jasmine"
36
35
  gem "jslint_on_rails"
37
36
  gem "launchy"
@@ -39,15 +38,8 @@ group :test do
39
38
  gem "rspec-rails"
40
39
  gem "i18n-spec"
41
40
  gem "shoulda-matchers", "<= 2.8.0"
42
- gem "sqlite3", :platforms => :mri
41
+ gem "sqlite3", platforms: :mri
43
42
  gem "poltergeist"
44
43
  end
45
44
 
46
- platforms :ruby_19 do
47
- gem "kaminari", "~> 0.15"
48
- gem "mime-types", "< 3"
49
- gem "nokogiri", "< 1.7"
50
- gem "public_suffix", "< 1.5"
51
- end
52
-
53
- gemspec :path => "../"
45
+ gemspec path: "../"
@@ -4,34 +4,33 @@ source "https://rubygems.org"
4
4
 
5
5
  gem "cancan"
6
6
  gem "pundit"
7
- gem "thor", "<= 0.19.1"
8
7
  gem "rake"
9
- gem "parallel_tests", "< 2.10"
8
+ gem "parallel_tests"
10
9
  gem "pry"
11
- gem "rails", "5.0.1"
10
+ gem "rubocop", "0.48.1"
11
+ gem "rails", "5.0.2"
12
12
  gem "jquery-ui-rails", "~> 5.0"
13
13
  gem "devise", "> 4.x"
14
- gem "inherited_resources", :git => "https://github.com/activeadmin/inherited_resources"
15
14
  gem "draper", "> 3.x"
16
- gem "activerecord-jdbcsqlite3-adapter", :git => "https://github.com/jruby/activerecord-jdbc-adapter", :branch => "rails-5", :platforms => :jruby
15
+ gem "activerecord-jdbcsqlite3-adapter", git: "https://github.com/jruby/activerecord-jdbc-adapter", branch: "rails-5", platforms: :jruby
17
16
 
18
17
  group :development do
19
- gem "better_errors", :platforms => [:ruby_20, :ruby_21, :ruby_22, :ruby_23, :ruby_24]
20
- gem "binding_of_caller", :platforms => :mri
18
+ gem "better_errors"
19
+ gem "binding_of_caller", platforms: :mri
21
20
  gem "rack-mini-profiler"
22
21
  gem "yard"
23
- gem "redcarpet", :platforms => :mri
24
- gem "kramdown", :platforms => :jruby
25
- gem "appraisal", :require => false
22
+ gem "redcarpet", platforms: :mri
23
+ gem "kramdown", platforms: :jruby
24
+ gem "appraisal", "~> 2.2", require: false
26
25
  end
27
26
 
28
27
  group :test do
29
28
  gem "capybara"
30
- gem "simplecov", :require => false
31
- gem "codecov", :require => false
32
- gem "cucumber-rails", :require => false
29
+ gem "simplecov", require: false
30
+ gem "codecov", require: false
31
+ gem "cucumber-rails", require: false
33
32
  gem "cucumber", "1.3.20"
34
- gem "database_cleaner"
33
+ gem "database_cleaner", git: "https://github.com/DatabaseCleaner/database_cleaner.git"
35
34
  gem "jasmine"
36
35
  gem "jslint_on_rails"
37
36
  gem "launchy"
@@ -39,8 +38,8 @@ group :test do
39
38
  gem "rspec-rails"
40
39
  gem "i18n-spec"
41
40
  gem "shoulda-matchers", "<= 2.8.0"
42
- gem "sqlite3", :platforms => :mri
41
+ gem "sqlite3", platforms: :mri
43
42
  gem "poltergeist"
44
43
  end
45
44
 
46
- gemspec :path => "../"
45
+ gemspec path: "../"
@@ -0,0 +1,45 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "cancan"
6
+ gem "pundit"
7
+ gem "rake"
8
+ gem "parallel_tests"
9
+ gem "pry"
10
+ gem "rubocop", "0.48.1"
11
+ gem "rails", "~> 5.1.x"
12
+ gem "jquery-ui-rails", "~> 5.0"
13
+ gem "devise", "> 4.x"
14
+ gem "draper", "> 3.x"
15
+ gem "activerecord-jdbcsqlite3-adapter", git: "https://github.com/jruby/activerecord-jdbc-adapter", branch: "rails-5", platforms: :jruby
16
+
17
+ group :development do
18
+ gem "better_errors"
19
+ gem "binding_of_caller", platforms: :mri
20
+ gem "rack-mini-profiler"
21
+ gem "yard"
22
+ gem "redcarpet", platforms: :mri
23
+ gem "kramdown", platforms: :jruby
24
+ gem "appraisal", "~> 2.2", require: false
25
+ end
26
+
27
+ group :test do
28
+ gem "capybara"
29
+ gem "simplecov", require: false
30
+ gem "codecov", require: false
31
+ gem "cucumber-rails", require: false
32
+ gem "cucumber", "1.3.20"
33
+ gem "database_cleaner", git: "https://github.com/DatabaseCleaner/database_cleaner.git"
34
+ gem "jasmine"
35
+ gem "jslint_on_rails"
36
+ gem "launchy"
37
+ gem "rails-i18n"
38
+ gem "rspec-rails"
39
+ gem "i18n-spec"
40
+ gem "shoulda-matchers", "<= 2.8.0"
41
+ gem "sqlite3", platforms: :mri
42
+ gem "poltergeist"
43
+ end
44
+
45
+ gemspec path: "../"
@@ -89,6 +89,10 @@ module ActiveAdmin
89
89
  # Display breadcrumbs
90
90
  inheritable_setting :breadcrumb, true
91
91
 
92
+ # Display create another checkbox on a new page
93
+ # @return [Boolean] (true)
94
+ inheritable_setting :create_another, false
95
+
92
96
  # Default CSV options
93
97
  inheritable_setting :csv_options, { col_sep: ',', byte_order_mark: "\xEF\xBB\xBF" }
94
98
 
@@ -10,13 +10,8 @@ module ActiveAdmin
10
10
 
11
11
  layout :determine_active_admin_layout
12
12
 
13
- if ActiveAdmin::Dependency.rails >= 4
14
- before_action :only_render_implemented_actions
15
- before_action :authenticate_active_admin_user
16
- else
17
- before_filter :only_render_implemented_actions
18
- before_filter :authenticate_active_admin_user
19
- end
13
+ before_action :only_render_implemented_actions
14
+ before_action :authenticate_active_admin_user
20
15
 
21
16
  class << self
22
17
  # Ensure that this method is available for the DSL
@@ -4,11 +4,7 @@ module ActiveAdmin
4
4
  extend ActiveSupport::Concern
5
5
 
6
6
  included do
7
- if ActiveAdmin::Dependency.rails >= 4
8
- before_action :set_current_tab
9
- else
10
- before_filter :set_current_tab
11
- end
7
+ before_action :set_current_tab
12
8
  helper_method :current_menu
13
9
  end
14
10
 
@@ -22,7 +22,7 @@ module ActiveAdmin
22
22
  def self.default_for_resource(resource)
23
23
  new resource: resource do
24
24
  column :id
25
- resource.content_columns.each { |c| column c.name.to_sym }
25
+ resource.content_columns.each { |c| column c }
26
26
  end
27
27
  end
28
28
 
@@ -105,7 +105,7 @@ module ActiveAdmin
105
105
 
106
106
  def humanize_name(name, resource, humanize_name_option)
107
107
  if humanize_name_option
108
- name.is_a?(Symbol) && resource.present? ? resource.human_attribute_name(name) : name.to_s.humanize
108
+ name.is_a?(Symbol) && resource ? resource.resource_class.human_attribute_name(name) : name.to_s.humanize
109
109
  else
110
110
  name.to_s
111
111
  end
@@ -21,11 +21,11 @@ module ActiveAdmin
21
21
  # ActiveAdmin::Dependency.draper? '~> 1.2.0'
22
22
  # => true
23
23
  #
24
- # ActiveAdmin::Dependency.rails? '>= 4.1.0', '<= 4.1.1'
24
+ # ActiveAdmin::Dependency.rails? '>= 4.2.7', '<= 5.0.2'
25
25
  # => true
26
26
  #
27
- # ActiveAdmin::Dependency.rails! '2'
28
- # -> ActiveAdmin::DependencyError: You provided rails 3.2.18 but we need: 2.
27
+ # ActiveAdmin::Dependency.rails! '5'
28
+ # -> ActiveAdmin::DependencyError: You provided rails 4.2.7 but we need: 5.
29
29
  #
30
30
  # ActiveAdmin::Dependency.devise!
31
31
  # -> ActiveAdmin::DependencyError: To use devise you need to specify it in your Gemfile.
@@ -33,7 +33,7 @@ module ActiveAdmin
33
33
  #
34
34
  # All but the pessimistic operator (~>) can also be run using Ruby's comparison syntax.
35
35
  #
36
- # ActiveAdmin::Dependency.rails >= '3.2.18'
36
+ # ActiveAdmin::Dependency.rails >= '4.2.7'
37
37
  # => true
38
38
  #
39
39
  # Which is especially useful if you're looking up a gem with dashes in the name.
@@ -134,10 +134,6 @@ module ActiveAdmin
134
134
  end
135
135
 
136
136
  class Rails < Base
137
- def strong_parameters?
138
- @version >= 4 || defined?(ActionController::StrongParameters)
139
- end
140
-
141
137
  def parameterize(string)
142
138
  if Dependency.rails5?
143
139
  string.parameterize separator: '_'