Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes for model status page on newer Rails. #38

Merged
merged 1 commit into from
Nov 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/controllers/models_controller.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class ModelsController < ApplicationController
def overview
@models = ModelFilter.filter_query(Model.where(true), params)
@models = ModelFilter.filter_query(Model.all, params)
base_query_params = params.slice(*ModelFilter.filterable_params)

raise ActiveRecord::RecordNotFound unless @models.any?
Expand Down
2 changes: 1 addition & 1 deletion app/model_filters/model_status_filter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ class ModelStatusFilter
include ModelFilter

def self.filter(rel, val)
if rel.values.empty? || rel.values[:where].reject { |c| c == true }.empty?
if rel.values.empty?
raise InvalidQueryError.new 'Find by status requires additional filtering!'
end
filtered_model_ids = rel.pluck(:genome_model_id)
Expand Down
2 changes: 1 addition & 1 deletion app/presenters/model_type_chart.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def get_chart_items(data_items)
ChartItem.new(
type, models.count,
@@color_list[index] || '#666666',
model_overview_path(@base_query_params.merge({subclass_name: type}))
model_overview_path(@base_query_params.permit!.merge({subclass_name: type}))
)
end
end
Expand Down