mirror of
https://github.com/manyfold3d/manyfold.git
synced 2026-10-23 12:12:21 -05:00
17 lines
371 B
Ruby
17 lines
371 B
Ruby
class HomeController < ApplicationController
|
|
include ModelFilters
|
|
before_action :check_library_exists
|
|
|
|
def index
|
|
@recent = policy_scope(Model).recent.limit(20)
|
|
# Eager load for performance
|
|
@recent = @recent.includes([:library, :model_files])
|
|
end
|
|
|
|
private
|
|
|
|
def check_library_exists
|
|
redirect_to new_library_path if Library.count === 0
|
|
end
|
|
end
|