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