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

Develop #15

Merged
merged 2 commits into from
Aug 29, 2017
Merged
Changes from 1 commit
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
Next Next commit
Add sort on fmu and observers column for observation
  • Loading branch information
ivanyukio committed Aug 29, 2017
commit af92040930c9c61585b10f812e30acb6ab2ca897
7 changes: 4 additions & 3 deletions app/admin/observation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ def self.observations
def scoped_collection
end_of_association_chain.includes([:translations, [country: :translations],
:severity, [operator: :translations],
[subcategory: :translations], [observer_observations: [observer: :translations]], :user])
[subcategory: :translations], [observer_observations: [observer: :translations]],
[fmu: :translations], :user])
end
end

Expand Down Expand Up @@ -68,8 +69,8 @@ def scoped_collection
selectable_column
tag_column 'Status', :validation_status, sortable: true
column :country, sortable: 'country_translations.name'
column :fmu
column :observers do |o|
column :fmu, sortable: 'fmu_translations.name'
column :observers, sortable: 'observer_translations.name' do |o|
o.observers.pluck(:name).join(', ')
end
column :operator, sortable: 'operator_translations.name'
Expand Down