Better orga admin
This commit is contained in:
parent
1675840d8b
commit
4307d2b7e2
@ -1,18 +1,21 @@
|
||||
ActiveAdmin.register Orga do
|
||||
permit_params :active, :kind_id, :name, :description, :url, :city, :region_id
|
||||
|
||||
scope :all, default: true
|
||||
scope :moderated
|
||||
scope :all
|
||||
scope :active, default: true
|
||||
scope :inactive
|
||||
scope :unmoderated
|
||||
|
||||
config.sort_order = 'updated_at_desc'
|
||||
|
||||
filter :active, as: :radio
|
||||
filter :kind, as: :check_boxes
|
||||
filter :name
|
||||
filter :region
|
||||
|
||||
index do
|
||||
column :id do |orga|
|
||||
link_to orga.id, orga
|
||||
end
|
||||
column :kind
|
||||
column :name
|
||||
column :city
|
||||
|
@ -22,6 +22,7 @@ class Orga < ApplicationRecord
|
||||
after_validation :geocode
|
||||
|
||||
scope :active, ->(value = true) { where active: value }
|
||||
scope :inactive, ->(value = false) { where active: value }
|
||||
scope :moderated, -> { where moderated: true }
|
||||
scope :unmoderated, -> { where moderated: false }
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user