activeadmin 2.9.0 → 2.10.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 (191) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +68 -1
  3. data/app/assets/javascripts/active_admin/base.js +12 -5
  4. data/app/assets/stylesheets/active_admin/_base.scss +43 -37
  5. data/app/assets/stylesheets/active_admin/_forms.scss +3 -3
  6. data/app/assets/stylesheets/active_admin/{print.scss → _print.scss} +0 -0
  7. data/app/views/active_admin/devise/shared/_links.erb +1 -1
  8. data/app/views/active_admin/page/index.html.arb +1 -0
  9. data/app/views/active_admin/resource/edit.html.arb +1 -0
  10. data/app/views/active_admin/resource/index.html.arb +1 -0
  11. data/app/views/active_admin/resource/new.html.arb +1 -0
  12. data/app/views/active_admin/resource/show.html.arb +1 -0
  13. data/app/views/layouts/active_admin.html.arb +1 -0
  14. data/config/locales/ko.yml +1 -1
  15. data/config/locales/nl.yml +1 -1
  16. data/config/locales/ro.yml +3 -2
  17. data/docs/0-installation.md +1 -1
  18. data/docs/8-custom-actions.md +1 -1
  19. data/docs/Gemfile +1 -0
  20. data/docs/Gemfile.lock +102 -79
  21. data/lib/active_admin/abstract_view_factory.rb +1 -0
  22. data/lib/active_admin/application.rb +7 -7
  23. data/lib/active_admin/application_settings.rb +1 -0
  24. data/lib/active_admin/asset_registration.rb +1 -0
  25. data/lib/active_admin/authorization_adapter.rb +1 -0
  26. data/lib/active_admin/base_controller/authorization.rb +1 -0
  27. data/lib/active_admin/base_controller/menu.rb +1 -0
  28. data/lib/active_admin/base_controller.rb +1 -1
  29. data/lib/active_admin/batch_actions/controller.rb +1 -0
  30. data/lib/active_admin/batch_actions/resource_extension.rb +1 -0
  31. data/lib/active_admin/batch_actions/views/batch_action_form.rb +1 -0
  32. data/lib/active_admin/batch_actions/views/batch_action_selector.rb +1 -0
  33. data/lib/active_admin/batch_actions/views/selection_cells.rb +1 -0
  34. data/lib/active_admin/batch_actions.rb +1 -0
  35. data/lib/active_admin/callbacks.rb +1 -0
  36. data/lib/active_admin/cancan_adapter.rb +1 -0
  37. data/lib/active_admin/collection_decorator.rb +1 -0
  38. data/lib/active_admin/component.rb +1 -0
  39. data/lib/active_admin/controller_action.rb +1 -0
  40. data/lib/active_admin/csv_builder.rb +1 -0
  41. data/lib/active_admin/dependency.rb +2 -1
  42. data/lib/active_admin/deprecation.rb +1 -0
  43. data/lib/active_admin/devise.rb +1 -0
  44. data/lib/active_admin/dsl.rb +1 -0
  45. data/lib/active_admin/dynamic_setting.rb +1 -0
  46. data/lib/active_admin/dynamic_settings_node.rb +1 -0
  47. data/lib/active_admin/engine.rb +1 -0
  48. data/lib/active_admin/error.rb +1 -0
  49. data/lib/active_admin/filters/active.rb +1 -0
  50. data/lib/active_admin/filters/active_filter.rb +1 -0
  51. data/lib/active_admin/filters/active_sidebar.rb +2 -28
  52. data/lib/active_admin/filters/dsl.rb +1 -0
  53. data/lib/active_admin/filters/forms.rb +1 -0
  54. data/lib/active_admin/filters/formtastic_addons.rb +1 -0
  55. data/lib/active_admin/filters/resource_extension.rb +1 -0
  56. data/lib/active_admin/filters.rb +1 -0
  57. data/lib/active_admin/form_builder.rb +1 -0
  58. data/lib/active_admin/generators/boilerplate.rb +1 -0
  59. data/lib/active_admin/helpers/collection.rb +2 -0
  60. data/lib/active_admin/helpers/i18n.rb +1 -0
  61. data/lib/active_admin/helpers/optional_display.rb +1 -0
  62. data/lib/active_admin/helpers/routes/url_helpers.rb +1 -0
  63. data/lib/active_admin/helpers/scope_chain.rb +1 -0
  64. data/lib/active_admin/inputs/datepicker_input.rb +1 -0
  65. data/lib/active_admin/inputs/filters/base/search_method_select.rb +1 -0
  66. data/lib/active_admin/inputs/filters/base.rb +1 -0
  67. data/lib/active_admin/inputs/filters/boolean_input.rb +1 -0
  68. data/lib/active_admin/inputs/filters/check_boxes_input.rb +1 -0
  69. data/lib/active_admin/inputs/filters/date_picker_input.rb +1 -0
  70. data/lib/active_admin/inputs/filters/date_range_input.rb +1 -0
  71. data/lib/active_admin/inputs/filters/numeric_input.rb +1 -0
  72. data/lib/active_admin/inputs/filters/select_input.rb +1 -0
  73. data/lib/active_admin/inputs/filters/string_input.rb +1 -0
  74. data/lib/active_admin/inputs/filters/text_input.rb +1 -0
  75. data/lib/active_admin/inputs.rb +1 -0
  76. data/lib/active_admin/localizers/resource_localizer.rb +1 -0
  77. data/lib/active_admin/localizers.rb +1 -0
  78. data/lib/active_admin/menu.rb +1 -0
  79. data/lib/active_admin/menu_collection.rb +1 -0
  80. data/lib/active_admin/menu_item.rb +1 -0
  81. data/lib/active_admin/namespace.rb +2 -1
  82. data/lib/active_admin/namespace_settings.rb +1 -0
  83. data/lib/active_admin/order_clause.rb +1 -0
  84. data/lib/active_admin/orm/active_record/comments/comment.rb +1 -0
  85. data/lib/active_admin/orm/active_record/comments/namespace_helper.rb +1 -0
  86. data/lib/active_admin/orm/active_record/comments/resource_helper.rb +1 -0
  87. data/lib/active_admin/orm/active_record/comments/show_page_helper.rb +1 -0
  88. data/lib/active_admin/orm/active_record/comments/views/active_admin_comments.rb +1 -0
  89. data/lib/active_admin/orm/active_record/comments/views.rb +1 -0
  90. data/lib/active_admin/orm/active_record/comments.rb +1 -0
  91. data/lib/active_admin/orm/active_record.rb +1 -0
  92. data/lib/active_admin/orm/mongoid.rb +1 -0
  93. data/lib/active_admin/page.rb +1 -0
  94. data/lib/active_admin/page_controller.rb +1 -0
  95. data/lib/active_admin/page_dsl.rb +1 -0
  96. data/lib/active_admin/page_presenter.rb +1 -0
  97. data/lib/active_admin/pundit_adapter.rb +1 -0
  98. data/lib/active_admin/resource/action_items.rb +1 -0
  99. data/lib/active_admin/resource/attributes.rb +1 -0
  100. data/lib/active_admin/resource/belongs_to.rb +1 -0
  101. data/lib/active_admin/resource/controllers.rb +1 -0
  102. data/lib/active_admin/resource/includes.rb +1 -0
  103. data/lib/active_admin/resource/menu.rb +1 -0
  104. data/lib/active_admin/resource/model.rb +1 -0
  105. data/lib/active_admin/resource/naming.rb +1 -0
  106. data/lib/active_admin/resource/ordering.rb +1 -0
  107. data/lib/active_admin/resource/page_presenters.rb +1 -0
  108. data/lib/active_admin/resource/pagination.rb +1 -0
  109. data/lib/active_admin/resource/routes.rb +1 -0
  110. data/lib/active_admin/resource/scope_to.rb +1 -0
  111. data/lib/active_admin/resource/scopes.rb +1 -0
  112. data/lib/active_admin/resource/sidebars.rb +1 -0
  113. data/lib/active_admin/resource.rb +1 -0
  114. data/lib/active_admin/resource_collection.rb +1 -0
  115. data/lib/active_admin/resource_controller/action_builder.rb +1 -0
  116. data/lib/active_admin/resource_controller/data_access.rb +3 -2
  117. data/lib/active_admin/resource_controller/decorators.rb +1 -0
  118. data/lib/active_admin/resource_controller/polymorphic_routes.rb +1 -0
  119. data/lib/active_admin/resource_controller/resource_class_methods.rb +1 -0
  120. data/lib/active_admin/resource_controller/scoping.rb +1 -0
  121. data/lib/active_admin/resource_controller/sidebars.rb +1 -0
  122. data/lib/active_admin/resource_controller/streaming.rb +1 -0
  123. data/lib/active_admin/resource_controller.rb +1 -0
  124. data/lib/active_admin/resource_dsl.rb +7 -21
  125. data/lib/active_admin/router.rb +1 -0
  126. data/lib/active_admin/scope.rb +1 -0
  127. data/lib/active_admin/settings_node.rb +1 -0
  128. data/lib/active_admin/sidebar_section.rb +1 -0
  129. data/lib/active_admin/version.rb +2 -1
  130. data/lib/active_admin/view_factory.rb +1 -0
  131. data/lib/active_admin/view_helpers/active_admin_application_helper.rb +1 -0
  132. data/lib/active_admin/view_helpers/auto_link_helper.rb +1 -0
  133. data/lib/active_admin/view_helpers/breadcrumb_helper.rb +1 -0
  134. data/lib/active_admin/view_helpers/display_helper.rb +11 -3
  135. data/lib/active_admin/view_helpers/download_format_links_helper.rb +1 -0
  136. data/lib/active_admin/view_helpers/fields_for.rb +1 -0
  137. data/lib/active_admin/view_helpers/flash_helper.rb +1 -0
  138. data/lib/active_admin/view_helpers/form_helper.rb +1 -0
  139. data/lib/active_admin/view_helpers/method_or_proc_helper.rb +1 -0
  140. data/lib/active_admin/view_helpers/scope_name_helper.rb +1 -0
  141. data/lib/active_admin/view_helpers/sidebar_helper.rb +1 -0
  142. data/lib/active_admin/view_helpers/title_helper.rb +1 -0
  143. data/lib/active_admin/view_helpers/view_factory_helper.rb +1 -0
  144. data/lib/active_admin/view_helpers.rb +1 -0
  145. data/lib/active_admin/views/action_items.rb +1 -0
  146. data/lib/active_admin/views/components/active_admin_form.rb +2 -1
  147. data/lib/active_admin/views/components/active_filters_sidebar_content.rb +59 -0
  148. data/lib/active_admin/views/components/attributes_table.rb +1 -0
  149. data/lib/active_admin/views/components/blank_slate.rb +1 -0
  150. data/lib/active_admin/views/components/columns.rb +1 -0
  151. data/lib/active_admin/views/components/dropdown_menu.rb +3 -5
  152. data/lib/active_admin/views/components/index_list.rb +1 -0
  153. data/lib/active_admin/views/components/menu.rb +1 -0
  154. data/lib/active_admin/views/components/menu_item.rb +1 -0
  155. data/lib/active_admin/views/components/paginated_collection.rb +1 -0
  156. data/lib/active_admin/views/components/panel.rb +1 -0
  157. data/lib/active_admin/views/components/scopes.rb +1 -0
  158. data/lib/active_admin/views/components/sidebar.rb +1 -0
  159. data/lib/active_admin/views/components/sidebar_section.rb +1 -0
  160. data/lib/active_admin/views/components/site_title.rb +1 -0
  161. data/lib/active_admin/views/components/status_tag.rb +1 -0
  162. data/lib/active_admin/views/components/table_for.rb +1 -0
  163. data/lib/active_admin/views/components/tabs.rb +1 -0
  164. data/lib/active_admin/views/components/unsupported_browser.rb +1 -0
  165. data/lib/active_admin/views/footer.rb +1 -0
  166. data/lib/active_admin/views/header.rb +1 -0
  167. data/lib/active_admin/views/index_as_block.rb +1 -0
  168. data/lib/active_admin/views/index_as_blog.rb +1 -0
  169. data/lib/active_admin/views/index_as_grid.rb +1 -0
  170. data/lib/active_admin/views/index_as_table.rb +1 -0
  171. data/lib/active_admin/views/pages/base.rb +4 -1
  172. data/lib/active_admin/views/pages/form.rb +1 -0
  173. data/lib/active_admin/views/pages/index.rb +1 -0
  174. data/lib/active_admin/views/pages/layout.rb +1 -0
  175. data/lib/active_admin/views/pages/page.rb +1 -0
  176. data/lib/active_admin/views/pages/show.rb +1 -0
  177. data/lib/active_admin/views/tabbed_navigation.rb +1 -0
  178. data/lib/active_admin/views/title_bar.rb +1 -0
  179. data/lib/active_admin/views.rb +1 -0
  180. data/lib/active_admin.rb +2 -1
  181. data/lib/activeadmin.rb +1 -0
  182. data/lib/generators/active_admin/assets/assets_generator.rb +1 -0
  183. data/lib/generators/active_admin/devise/devise_generator.rb +1 -0
  184. data/lib/generators/active_admin/install/install_generator.rb +1 -0
  185. data/lib/generators/active_admin/install/templates/dashboard.rb +1 -0
  186. data/lib/generators/active_admin/page/page_generator.rb +1 -0
  187. data/lib/generators/active_admin/page/templates/page.rb +1 -0
  188. data/lib/generators/active_admin/resource/resource_generator.rb +1 -0
  189. data/lib/generators/active_admin/webpacker/webpacker_generator.rb +1 -0
  190. data/lib/ransack_ext.rb +1 -0
  191. metadata +11 -10
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module ActiveAdmin
2
3
  module Helpers
3
4
  module I18n
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module ActiveAdmin
2
3
 
3
4
  # Shareable module to give a #display_on?(action) method
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module ActiveAdmin
2
3
  module Helpers
3
4
  module Routes
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module ActiveAdmin
2
3
  module ScopeChain
3
4
  private
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module ActiveAdmin
2
3
  module Inputs
3
4
  class DatepickerInput < ::Formtastic::Inputs::StringInput
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  # This is a common set of Formtastic overrides needed to build a filter form
2
3
  # that lets you select from a set of search methods for a given attribute.
3
4
  #
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module ActiveAdmin
2
3
  module Inputs
3
4
  module Filters
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module ActiveAdmin
2
3
  module Inputs
3
4
  module Filters
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module ActiveAdmin
2
3
  module Inputs
3
4
  module Filters
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module ActiveAdmin
2
3
  module Inputs
3
4
  module Filters
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module ActiveAdmin
2
3
  module Inputs
3
4
  module Filters
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module ActiveAdmin
2
3
  module Inputs
3
4
  module Filters
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module ActiveAdmin
2
3
  module Inputs
3
4
  module Filters
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module ActiveAdmin
2
3
  module Inputs
3
4
  module Filters
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module ActiveAdmin
2
3
  module Inputs
3
4
  module Filters
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module ActiveAdmin
2
3
  module Inputs
3
4
  extend ActiveSupport::Autoload
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module ActiveAdmin
2
3
  module Localizers
3
4
  class ResourceLocalizer
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require "active_admin/localizers/resource_localizer"
2
3
 
3
4
  module ActiveAdmin
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module ActiveAdmin
2
3
 
3
4
  # Each Namespace builds up it's own menu as the global navigation
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module ActiveAdmin
2
3
 
3
4
  DEFAULT_MENU = :default
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module ActiveAdmin
2
3
  class MenuItem
3
4
  include Menu::MenuNode
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require "active_admin/resource_collection"
2
3
 
3
4
  module ActiveAdmin
@@ -71,7 +72,7 @@ module ActiveAdmin
71
72
  reset_menu!
72
73
 
73
74
  # Dispatch a registration event
74
- ActiveSupport::Notifications.publish ActiveAdmin::Resource::RegisterEvent, config
75
+ ActiveSupport::Notifications.instrument ActiveAdmin::Resource::RegisterEvent, config
75
76
 
76
77
  # Return the config
77
78
  config
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require "active_admin/dynamic_settings_node"
2
3
 
3
4
  module ActiveAdmin
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module ActiveAdmin
2
3
  class OrderClause
3
4
  attr_reader :field, :order, :active_admin_config
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module ActiveAdmin
2
3
  class Comment < ActiveRecord::Base
3
4
 
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module ActiveAdmin
2
3
  module Comments
3
4
 
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module ActiveAdmin
2
3
  module Comments
3
4
 
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module ActiveAdmin
2
3
  module Comments
3
4
 
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require "active_admin/views"
2
3
  require "active_admin/views/components/panel"
3
4
 
@@ -1,2 +1,3 @@
1
+ # frozen_string_literal: true
1
2
  require "active_admin/views"
2
3
  require "active_admin/orm/active_record/comments/views/active_admin_comments"
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require "active_admin/orm/active_record/comments/views"
2
3
  require "active_admin/orm/active_record/comments/show_page_helper"
3
4
  require "active_admin/orm/active_record/comments/namespace_helper"
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  # ActiveRecord-specific plugins should be required here
2
3
 
3
4
  ActiveAdmin::DatabaseHitDuringLoad.database_error_classes << ActiveRecord::StatementInvalid
@@ -1 +1,2 @@
1
+ # frozen_string_literal: true
1
2
  # Mongoid-specific plugins should be required here
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module ActiveAdmin
2
3
  # Page is the primary data storage for page configuration in Active Admin
3
4
  #
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module ActiveAdmin
2
3
 
3
4
  # All Pages controllers inherit from this controller.
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module ActiveAdmin
2
3
  # This is the class where all the register_page blocks are evaluated.
3
4
  class PageDSL < DSL
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module ActiveAdmin
2
3
 
3
4
  # A simple object that gets used to present different aspects of views
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  ActiveAdmin::Dependency.pundit!
2
3
 
3
4
  require "pundit"
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require "active_admin/helpers/optional_display"
2
3
 
3
4
  module ActiveAdmin
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module ActiveAdmin
2
3
 
3
4
  class Resource
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require "active_admin/resource"
2
3
 
3
4
  module ActiveAdmin
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module ActiveAdmin
2
3
  class Resource
3
4
  module Controllers
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module ActiveAdmin
2
3
  class Resource
3
4
  module Includes
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module ActiveAdmin
2
3
  class Resource
3
4
 
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module ActiveAdmin
2
3
  class Model
3
4
  def initialize(resource, record)
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module ActiveAdmin
2
3
  class Resource
3
4
 
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module ActiveAdmin
2
3
  class Resource
3
4
  module Ordering
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module ActiveAdmin
2
3
  class Resource
3
4
  module PagePresenters
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module ActiveAdmin
2
3
 
3
4
  class Resource
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module ActiveAdmin
2
3
  class Resource
3
4
  module Routes
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module ActiveAdmin
2
3
  class Resource
3
4
  module ScopeTo
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module ActiveAdmin
2
3
  class Resource
3
4
  module Scopes
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require "active_admin/helpers/optional_display"
2
3
 
3
4
  module ActiveAdmin
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require "active_admin/resource/action_items"
2
3
  require "active_admin/resource/attributes"
3
4
  require "active_admin/resource/controllers"
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module ActiveAdmin
2
3
  # This is a container for resources, which acts much like a Hash.
3
4
  # It's assumed that an added resource responds to `resource_name`.
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module ActiveAdmin
2
3
  class ResourceController < BaseController
3
4
 
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module ActiveAdmin
2
3
  class ResourceController < BaseController
3
4
 
@@ -23,9 +24,9 @@ module ActiveAdmin
23
24
 
24
25
  COLLECTION_APPLIES = [
25
26
  :authorization_scope,
26
- :sorting,
27
27
  :filtering,
28
28
  :scoping,
29
+ :sorting,
29
30
  :includes,
30
31
  :pagination,
31
32
  :collection_decorator
@@ -128,7 +129,7 @@ module ActiveAdmin
128
129
  #
129
130
  # @return [ActiveRecord::Base] An un-saved active record base object
130
131
  def build_new_resource
131
- scoped_collection.send(
132
+ apply_authorization_scope(scoped_collection).send(
132
133
  method_for_build,
133
134
  *resource_params.map { |params| params.slice(active_admin_config.resource_class.inheritance_column) }
134
135
  )
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module ActiveAdmin
2
3
  class ResourceController < BaseController
3
4
  module Decorators
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require "active_admin/resource"
2
3
  require "active_admin/resource/model"
3
4
 
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module ActiveAdmin
2
3
  class ResourceController < BaseController
3
4
  module ResourceClassMethods
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module ActiveAdmin
2
3
  class ResourceController < BaseController
3
4
 
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module ActiveAdmin
2
3
  class ResourceController < BaseController
3
4
 
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require "csv"
2
3
 
3
4
  module ActiveAdmin
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require "active_admin/collection_decorator"
2
3
  require "active_admin/resource_controller/action_builder"
3
4
  require "active_admin/resource_controller/data_access"
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module ActiveAdmin
2
3
  # This is the class where all the register blocks are evaluated.
3
4
  class ResourceDSL < DSL
@@ -62,11 +63,12 @@ module ActiveAdmin
62
63
  #
63
64
  def permit_params(*args, &block)
64
65
  param_key = config.param_key.to_sym
65
- belongs_to_param = config.belongs_to_param
66
- create_another_param = :create_another if config.create_another
67
66
 
68
67
  controller do
69
68
  define_method :permitted_params do
69
+ belongs_to_param = active_admin_config.belongs_to_param
70
+ create_another_param = :create_another if active_admin_config.create_another
71
+
70
72
  permitted_params =
71
73
  active_admin_namespace.permitted_params +
72
74
  Array.wrap(belongs_to_param) +
@@ -189,25 +191,9 @@ module ActiveAdmin
189
191
  delegate :before_save, :after_save, to: :controller
190
192
  delegate :before_destroy, :after_destroy, to: :controller
191
193
 
192
- # This code defines both *_filter and *_action for Rails 5.0 and *_action for Rails >= 5.1
193
- phases = [
194
- :before, :skip_before,
195
- :after, :skip_after,
196
- :around, :skip
197
- ]
198
- keywords = if Rails::VERSION::MAJOR == 5 && Rails::VERSION::MINOR >= 1
199
- [:action]
200
- else
201
- [:action, :filter]
202
- end
203
-
204
- keywords.each do |name|
205
- phases.each do |action|
206
- define_method "#{action}_#{name}" do |*args, &block|
207
- controller.public_send "#{action}_action", *args, &block
208
- end
209
- end
210
- end
194
+ standard_rails_filters =
195
+ AbstractController::Callbacks::ClassMethods.public_instance_methods.select { |m| m.match(/_action\z/) }
196
+ delegate *standard_rails_filters, to: :controller
211
197
 
212
198
  # Specify which actions to create in the controller
213
199
  #
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module ActiveAdmin
2
3
  # @private
3
4
  class Router
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module ActiveAdmin
2
3
  class Scope
3
4
 
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module ActiveAdmin
2
3
 
3
4
  class SettingsNode
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module ActiveAdmin
2
3
 
3
4
  class SidebarSection
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module ActiveAdmin
2
- VERSION = "2.9.0"
3
+ VERSION = "2.10.0"
3
4
  end
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require "active_admin/abstract_view_factory"
2
3
 
3
4
  module ActiveAdmin
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module ActiveAdmin
2
3
  module ViewHelpers
3
4
  module ActiveAdminApplicationHelper
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module ActiveAdmin
2
3
  module ViewHelpers
3
4
  module AutoLinkHelper
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module ActiveAdmin
2
3
  module ViewHelpers
3
4
  module BreadcrumbHelper
@@ -1,14 +1,22 @@
1
+ # frozen_string_literal: true
1
2
  module ActiveAdmin
2
3
  module ViewHelpers
3
4
  module DisplayHelper
4
5
 
5
6
  DISPLAY_NAME_FALLBACK = -> {
6
- name = ""
7
7
  klass = self.class
8
- name << klass.model_name.human if klass.respond_to? :model_name
9
- name << " ##{send(klass.primary_key)}" if klass.respond_to? :primary_key
8
+ name = if klass.respond_to?(:model_name)
9
+ if klass.respond_to?(:primary_key)
10
+ "#{klass.model_name.human} ##{send(klass.primary_key)}"
11
+ else
12
+ klass.model_name.human
13
+ end
14
+ elsif klass.respond_to?(:primary_key)
15
+ " ##{send(klass.primary_key)}"
16
+ end
10
17
  name.present? ? name : to_s
11
18
  }
19
+
12
20
  def DISPLAY_NAME_FALLBACK.inspect
13
21
  "DISPLAY_NAME_FALLBACK"
14
22
  end
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module ActiveAdmin
2
3
  module ViewHelpers
3
4
  module DownloadFormatLinksHelper
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module ActiveAdmin
2
3
  module ViewHelpers
3
4
  module FormHelper
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module ActiveAdmin
2
3
  module ViewHelpers
3
4
  module FlashHelper
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module ActiveAdmin
2
3
  module ViewHelpers
3
4
  module FormHelper
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  # Utility methods for internal use.
2
3
  # @private
3
4
  module MethodOrProcHelper
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module ActiveAdmin
2
3
  module ViewHelpers
3
4
  module ScopeNameHelper
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module ActiveAdmin
2
3
  module ViewHelpers
3
4
  module SidebarHelper
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module ActiveAdmin
2
3
  module ViewHelpers
3
4
  module TitleHelper
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module ActiveAdmin
2
3
  module ViewHelpers
3
4
  module ViewFactoryHelper
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module ActiveAdmin
2
3
  module ViewHelpers
3
4
 
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module ActiveAdmin
2
3
  module Views
3
4