Skip to content

Commit

Permalink
minor: fix formatting violations detected/changed by rufo
Browse files Browse the repository at this point in the history
  • Loading branch information
robinboening committed Jul 5, 2021
1 parent f30bd1a commit 3494c8e
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 16 deletions.
4 changes: 2 additions & 2 deletions app/controllers/alchemy/admin/resources_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ def argument_scope_filter?(filter)
end

def sanitize_filter_params!
search_filter_params[:filter].reject! do |_,v|
search_filter_params[:filter].reject! do |_, v|
eligible_resource_filter_values.exclude?(v)
end
end
Expand Down Expand Up @@ -201,7 +201,7 @@ def common_search_filter_includes

if resource_has_filters
search_filters << {
filter: resource_model.alchemy_resource_filters.map { |f| f[:name] }
filter: resource_model.alchemy_resource_filters.map { |f| f[:name] },
}
end

Expand Down
6 changes: 3 additions & 3 deletions app/models/alchemy/attachment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,12 @@ def alchemy_resource_filters
[
{
name: :filter,
values: %w(recent last_upload without_tag)
values: %w(recent last_upload without_tag),
},
{
name: :by_file_type,
values: distinct.pluck(:file_mime_type).map { |type| [Alchemy.t(type, scope: "mime_types"), type] }.sort_by(&:first)
}
values: distinct.pluck(:file_mime_type).map { |type| [Alchemy.t(type, scope: "mime_types"), type] }.sort_by(&:first),
},
]
end

Expand Down
6 changes: 3 additions & 3 deletions app/models/alchemy/page.rb
Original file line number Diff line number Diff line change
Expand Up @@ -185,12 +185,12 @@ def alchemy_resource_filters
[
{
name: :by_page_layout,
values: PageLayout.all.map { |p| [Alchemy.t(p["name"], scope: "page_layout_names"), p["name"]] }
values: PageLayout.all.map { |p| [Alchemy.t(p["name"], scope: "page_layout_names"), p["name"]] },
},
{
name: :status,
values: %w[published not_public restricted]
}
values: %w[published not_public restricted],
},
]
end

Expand Down
6 changes: 3 additions & 3 deletions app/models/alchemy/picture.rb
Original file line number Diff line number Diff line change
Expand Up @@ -139,12 +139,12 @@ def alchemy_resource_filters
[
{
name: :filter,
values: %w(recent last_upload without_tag)
values: %w(recent last_upload without_tag),
},
{
name: :by_file_format,
values: distinct.pluck(:image_file_format)
}
values: distinct.pluck(:image_file_format),
},
]
end

Expand Down
2 changes: 1 addition & 1 deletion app/views/alchemy/admin/pictures/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
file_attribute: 'image_file',
redirect_url: alchemy.admin_pictures_path(
size: @size,
filter: {filter: 'last_upload'}
filter: { filter: 'last_upload' }
) %>
<div class="toolbar_spacer"></div>
<% end %>
Expand Down
3 changes: 2 additions & 1 deletion lib/alchemy/resource_filter.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module Alchemy
class ResourceFilter
attr_reader :name
Expand Down Expand Up @@ -33,7 +35,6 @@ def translated_values
else
@values.map { |v| Alchemy.t(v.to_sym, scope: ["filters", @resource_name, @name, "values"]) }
end

end
end
end
6 changes: 3 additions & 3 deletions spec/dummy/app/models/event.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@ class Event < ActiveRecord::Base

def self.alchemy_resource_relations
{
location: {attr_method: "name", attr_type: "string"},
location: { attr_method: "name", attr_type: "string" },
}
end

def self.alchemy_resource_filters
[
{
name: :start,
values: %w(starting_today future)
}
values: %w(starting_today future),
},
]
end

Expand Down

0 comments on commit 3494c8e

Please sign in to comment.