8000 Merge pull request #5162 from varyonic/feature/indentation-fix · stephancom/activeadmin@defc9ca · GitHub
[go: up one dir, main page]

Skip to content

Commit defc9ca

Browse files
authored
Merge pull request activeadmin#5162 from varyonic/feature/indentation-fix
Comment indentation error in index_as_grid.rb
2 parents 3b338ae + d8f6e18 commit defc9ca

File tree

6 files changed

+37
-31
lines changed

6 files changed

+37
-31
lines changed

.rubocop.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,15 @@ AllCops:
2121
Lint/EndAlignment:
2222
Enabled: true
2323

24+
Layout/AccessModifierIndentation:
25+
Enabled: true
26+
2427
Layout/CaseIndentation:
2528
Enabled: true
2629

30+
Layout/CommentIndentation:
31+
Enabled: true
32+
2733
Layout/ElseAlignment:
2834
Enabled: true
2935

lib/active_admin/application.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ def controllers_for_filters
155155
controllers
156156
end
157157

158-
private
158+
private
159159

160160
# Since app/admin is alphabetically before app/models, we have to remove it
161161
# from the host app's +autoload_paths+ to prevent missing constant errors.

lib/active_admin/filters/resource_extension.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def reset_filters!
8383
@filters_to_remove = nil
8484
end
8585

86-
private
86+
private
8787

8888
# Collapses the waveform, if you will, of which filters should be displayed.
8989
# Removes filters and adds in default filters as desired.

lib/active_admin/resource_controller/decorators.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ module ActiveAdmin
22
class ResourceController < BaseController
33
module Decorators
44

5-
protected
5+
protected
66

77
def apply_decorator(resource)
88
decorate? ? decorator_class.new(resource) : resource
@@ -24,7 +24,7 @@ def self.undecorate(resource)
2424
end
2525
end
2626

27-
private
27+
private
2828

2929
def decorate?
3030
case action_name
@@ -62,7 +62,7 @@ def self.wrap(decorator)
6262
end
6363
end
6464

65-
private
65+
private
6666

6767
def self.wrap!(parent, name)
6868
::Class.new parent do

lib/active_admin/views/index_as_grid.rb

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,30 @@
11
module ActiveAdmin
22
module Views
33

4-
# # Index as a Grid
5-
#
6-
# Sometimes you want to display the index screen for a set of resources as a grid
7-
# (possibly a grid of thumbnail images). To do so, use the :grid option for the
8-
# index block.
9-
#
10-
# ```ruby
11-
# index as: :grid do |product|
12-
# link_to image_tag(product.image_path), admin_product_path(product)
13-
# end
14-
# ```
15-
#
16-
# The block is rendered within a cell in the grid once for each resource in the
17-
# collection. The resource is passed into the block for you to use in the view.
18-
#
19-
# You can customize the number of columns that are rendered using the columns
20-
# option:
21-
#
22-
# ```ruby
23-
# index as: :grid, columns: 5 do |product|
24-
# link_to image_tag(product.image_path), admin_product_path(product)
25-
# end
26-
# ```
27-
#
4+
# # Index as a Grid
5+
#
6+
# Sometimes you want to display the index screen for a set of resources as a grid
7+
# (possibly a grid of thumbnail images). To do so, use the :grid option for the
8+
# index block.
9+
#
10+
# ```ruby
11+
# index as: :grid do |product|
12+
# link_to image_tag(product.image_path), admin_product_path(product)
13+
# end
14+
# ```
15+
#
16+
# The block is rendered within a cell in the grid once for each resource in the
17+
# collection. The resource is passed into the block for you to use in the view.
18+
#
19+
# You can customize the number of columns that are rendered using the columns
20+
# option:
21+
#
22+
# ```ruby
23+
# index as: :grid, columns: 5 do |product|
24+
# link_to image_tag(product.image_path), admin_product_path(product)
25+
# end
26+
# ```
27+
#
2828
class IndexAsGrid < ActiveAdmin::Component
2929

3030
def build(page_presenter, collection)
@@ -42,7 +42,7 @@ def self.index_name
4242
"grid"
4343
end
4444

45-
protected
45+
protected
4646

4747
def build_table
4848
resource_selection_toggle_panel if active_admin_config.batch_actions.any?

lib/active_admin/views/index_as_table.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ def actions(options = {}, &block)
362362
end
363363
end
364364

365-
private
365+
private
366366

367367
def defaults(resource, options = {})
368368
if controller.action_methods.include?('show') && authorized?(ActiveAdmin::Auth::READ, resource)

0 commit comments

Comments
 (0)
0