fix error
This commit is contained in:
parent
209903f35d
commit
eca64d50cc
|
@ -1,11 +1,5 @@
|
|||
class ArchivesController < ApplicationController
|
||||
#avoid the categories to be not in the ArchiveCategory
|
||||
before_action :set_archive_sort_order, only: [:index, :widget]
|
||||
def set_archive_sort_order
|
||||
if ArchiveSortOrder.count == 0
|
||||
ArchiveSortOrder.new('sort_order' => false).save
|
||||
end
|
||||
end
|
||||
def serve_cmap
|
||||
serve_path=File.expand_path("../../assets/javascripts/archive/pdf/bcmaps/#{params[:file_name]}.#{params[:extension]}",__FILE__)
|
||||
if Dir.glob(serve_path).length != 0
|
||||
|
|
|
@ -3,6 +3,12 @@ module Archive
|
|||
|
||||
initializer "archive" do
|
||||
require File.expand_path('../../../app/models/archive_category', __FILE__)
|
||||
require File.expand_path('../../../app/models/archive_sort_order', __FILE__)
|
||||
if defined?(ArchiveSortOrder)
|
||||
if ArchiveSortOrder.count == 0
|
||||
ArchiveSortOrder.create('sort_order' => false)
|
||||
end
|
||||
end
|
||||
require "#{ENV['PWD']}/app/models/category"
|
||||
require "#{ENV['PWD']}/app/models/module_app"
|
||||
|
||||
|
|
Loading…
Reference in New Issue