From 0f168e366e19c9dc68b077d2be096108e8fb5b5e Mon Sep 17 00:00:00 2001 From: Harry Bomrah Date: Tue, 22 Dec 2015 19:52:35 +0800 Subject: [PATCH] announcement_Setting fix --- app/models/announcement_setting.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/announcement_setting.rb b/app/models/announcement_setting.rb index 59b7e08..568d7cb 100644 --- a/app/models/announcement_setting.rb +++ b/app/models/announcement_setting.rb @@ -5,7 +5,7 @@ class AnnouncementSetting field :top_limit, type: Integer, :default => 0 def self.check_limit_for_user(user_id, b_id = nil) - limit = self.first.top_limit + limit = self.first.top_limit rescue 0 return true if limit == 0 count = Bulletin.where(:is_top => true, :create_user_id => user_id, :id.ne => b_id).count return count < limit