1.fix for syntax error.

2.Making production console works.
3.Making blank site member no errors.
This commit is contained in:
Matt K. Fu 2013-05-15 14:57:11 +08:00
parent 4a5256bf4f
commit 3d0a1cef56
3 changed files with 3 additions and 3 deletions

View File

@ -50,7 +50,7 @@ gem 'tinymce-rails'
gem 'therubyracer' if RUBY_PLATFORM.downcase.include?("linux")
gem 'libv8', '~> 3.11.8' if RUBY_PLATFORM.downcase.include?("linux")
gem 'mongoid-encryptor', :require => 'mongoid/encryptor'
gem 'rb-readline' if RUBY_PLATFORM.downcase.include?("linux")
gem 'rb-readline','~> 0.4.2' if RUBY_PLATFORM.downcase.include?("linux")
gem "impressionist", :git => 'git://github.com/charlotte-ruby/impressionist.git'

View File

@ -13,7 +13,7 @@ namespace :site do
puts 'Please upload design package (/admin/designs/upload_package ) and run rake site:necessary_data'
I18nVariable.create!( :document_class => 'language', :key => 'en', :en => 'English', :zh_tw => '英文' )
I18nVariable.create!( :document_class => 'language', :key => 'zh_tw', :en => 'Chinese', :zh_tw => '中文' )
Info.create!(key: "profile", built_in: true, disabled: false, title: {"zh_tw"=>"基本欄位", "en"=>"Basic Info"}, to_search: false)
end
task :necessary_data => :environment do

View File

@ -34,7 +34,7 @@ class Panel::Announcement::Widget::BulletinsController < OrbitWidgetController
@bulletins = Bulletin.available_for_lang(I18n.locale).can_display.where(:bulletin_category_id => @category_id).any_of( {deadline: nil,:postdate.lte => date_now} , {:deadline.gte => date_now,:postdate.lte => date_now} ).desc( :is_top, :postdate).page( params[:page] ).per(@page_num)
@current_category = BulletinCategory.from_id(@category_id) rescue nil
elsif !params[:tag_id].blank?
@bulletins = Bulletin.available_for_lang(I18n.locale).can_display.where(:tagged_ids => params[:tag_id])any_of( {deadline: nil,:postdate.lte => date_now} , {:deadline.gte => date_now,:postdate.lte => date_now} ).desc( :is_top, :postdate).page( params[:page] ).per(@page_num)
@bulletins = Bulletin.available_for_lang(I18n.locale).can_display.where(:tagged_ids => params[:tag_id]).any_of( {deadline: nil,:postdate.lte => date_now} , {:deadline.gte => date_now,:postdate.lte => date_now} ).desc( :is_top, :postdate).page( params[:page] ).per(@page_num)
else
@bulletins = Bulletin.available_for_lang(I18n.locale).can_display.any_of( {deadline: nil,:postdate.lte => date_now} , {:deadline.gte => date_now,:postdate.lte => date_now} ).desc( :is_top, :postdate).page( params[:page] ).per(@page_num)
end