refact
This commit is contained in:
@@ -96,6 +96,10 @@ ActiveAdmin.register WarpEngine::ApplicationToken, as: "Application Token" do
|
||||
end
|
||||
|
||||
controller do
|
||||
def scoped_collection
|
||||
super.kept
|
||||
end
|
||||
|
||||
def create
|
||||
create! do |success, _failure|
|
||||
success.html do
|
||||
|
||||
@@ -100,7 +100,7 @@ ActiveAdmin.register WarpEngine::Download, as: "Download" do
|
||||
|
||||
controller do
|
||||
def scoped_collection
|
||||
super.includes(release: :software)
|
||||
super.kept.includes(release: :software)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -5,6 +5,12 @@ ActiveAdmin.register WarpEngine::ExternalLink, as: "External Link" do
|
||||
|
||||
belongs_to :software
|
||||
|
||||
controller do
|
||||
def scoped_collection
|
||||
super.kept
|
||||
end
|
||||
end
|
||||
|
||||
index do
|
||||
selectable_column
|
||||
id_column
|
||||
|
||||
@@ -47,7 +47,7 @@ ActiveAdmin.register WarpEngine::Pipeline, as: "Pipeline" do
|
||||
f.inputs do
|
||||
f.input :platform, as: :select, collection: WarpEngine::PlatformLink::SUPPORTED_PLATFORMS
|
||||
f.input :software_id, as: :select,
|
||||
collection: WarpEngine::Software.order(:title).map { |s| [ s.title, s.id ] },
|
||||
collection: WarpEngine::Software.kept.order(:title).map { |s| [ s.title, s.id ] },
|
||||
include_blank: "- none -",
|
||||
hint: "One pipeline per software. Picking one that another pipeline already " \
|
||||
"has moves the link here — that pipeline is left without a software, " \
|
||||
@@ -124,7 +124,7 @@ ActiveAdmin.register WarpEngine::Pipeline, as: "Pipeline" do
|
||||
|
||||
controller do
|
||||
def scoped_collection
|
||||
super.includes(:software)
|
||||
super.kept.includes(:software)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -14,6 +14,12 @@ ActiveAdmin.register WarpEngine::PlatformLink, as: "Platform Link" do
|
||||
scope("Bevy") { |s| s.where(platform: "bevy") }
|
||||
scope("Phaser") { |s| s.where(platform: "phaser") }
|
||||
|
||||
controller do
|
||||
def scoped_collection
|
||||
super.kept
|
||||
end
|
||||
end
|
||||
|
||||
index do
|
||||
selectable_column
|
||||
id_column
|
||||
|
||||
@@ -17,6 +17,12 @@ ActiveAdmin.register WarpEngine::Release, as: "Release" do
|
||||
|
||||
filter :version
|
||||
|
||||
controller do
|
||||
def scoped_collection
|
||||
super.kept
|
||||
end
|
||||
end
|
||||
|
||||
show do
|
||||
attributes_table do
|
||||
row :id
|
||||
|
||||
@@ -150,7 +150,7 @@ ActiveAdmin.register WarpEngine::Software, as: "Software" do
|
||||
|
||||
controller do
|
||||
def scoped_collection
|
||||
super.includes({ releases: :release_assets }, software_images: :image)
|
||||
super.kept.includes({ releases: :release_assets }, software_images: :image)
|
||||
end
|
||||
|
||||
def find_resource
|
||||
|
||||
Reference in New Issue
Block a user