From 23071a364da01a0c3f5e2327e9979260effc6290 Mon Sep 17 00:00:00 2001 From: saurabhbhatia Date: Wed, 4 Dec 2013 17:48:23 +0800 Subject: [PATCH] Site rescue nil --- app/models/site.rb | 2 +- app/views/admin/sites/responsive_setting.html.erb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/site.rb b/app/models/site.rb index 79238d82..81006454 100644 --- a/app/models/site.rb +++ b/app/models/site.rb @@ -19,7 +19,7 @@ class Site field :sitemap_menu_in_header, :type => Boolean, :default => false field :enable_terms_of_use, :type => Boolean, :default => false field :enable_language_detection, :type => Boolean, :default => false - field :announcement_category, :type => Array + field :announcement_category, :type => Array, :default=>[] field :title_always_on, :type => Boolean, :default => false field :dashbroad_allow_visitor, :type => Boolean, :default => false diff --git a/app/views/admin/sites/responsive_setting.html.erb b/app/views/admin/sites/responsive_setting.html.erb index 5d9ba8cf..14e70822 100644 --- a/app/views/admin/sites/responsive_setting.html.erb +++ b/app/views/admin/sites/responsive_setting.html.erb @@ -30,7 +30,7 @@
<% @module.categories.each do |category| %> - <%= check_box_tag "site[announcement_category][]", category.id.to_s, @site.announcement_category.include?(category), :class=>"toggle-check", :data => { :title => "#{category.title}", disabled: true }, "data-deploy"=>"inline", :checked => (@site.announcement_category.include?(category.id.to_s)) %> + <%= check_box_tag "site[announcement_category][]", category.id.to_s, (@site.announcement_category.include?(category) rescue false), :class=>"toggle-check", :data => { :title => "#{category.title}", disabled: true }, "data-deploy"=>"inline", :checked => (@site.announcement_category.include?(category.id.to_s)) %> <% end %>