socialforge/app/controllers/stores_controller.rb

29 lines
1.1 KiB
Ruby
Raw Normal View History

# Trustie - education management software
# Copyright (C) 2013-2014
class StoresController < ApplicationController
layout 'base_stores'
# menu_item :overview
# menu_item :roadmap, :only => :roadmap
# menu_item :settings, :only => :settings
# include ActsAsTaggableOn::TagsHelper
2014-01-13 16:24:13 +08:00
LIMIT = 20 unless const_defined?(:LIMIT)
def index
2014-01-13 16:24:13 +08:00
#Document HomeworkAttach Issue Message News Version WikiPage
projects_attach
@projects_attach = Attachment.includes(:attach_project).where("projects.project_type=?", 0).
reorder("#{Attachment.table_name}.created_on DESC").
limit(LIMIT)
@courses_attach = Attachment.includes(:attach_project).where("projects.project_type=?", 1).
reorder("#{Attachment.table_name}.created_on DESC").
limit(LIMIT)
@homeworks_attach = Attachment.where("container_type = 'HomeworkAttach'").
reorder("created_on DESC").
limit(LIMIT)
@memos_attach = Attachment.where("container_type = 'Memo'").
reorder("created_on DESC").
limit(LIMIT)
end
2014-01-11 09:08:15 +08:00
end