From 0655baab192dd45c15e9cebac2ab11f53eaa5882 Mon Sep 17 00:00:00 2001 From: Fu Matthew Date: Thu, 27 Dec 2012 15:03:11 +0800 Subject: [PATCH 1/2] make longer devise timeout --- config/initializers/devise.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/initializers/devise.rb b/config/initializers/devise.rb index 1a997c5f0..8ab419a15 100644 --- a/config/initializers/devise.rb +++ b/config/initializers/devise.rb @@ -80,7 +80,7 @@ Devise.setup do |config| # The time you want to timeout the user session without activity. After this # time the user will be asked for credentials again. # config.timeout_in = 10.minutes - config.timeout_in = 10.minutes + config.timeout_in = 5.days # ==> Configuration for :lockable # Defines which strategy will be used to lock an account. From 2dd0f9a9d2e937a9ed7c19c220e7319bff2bfd79 Mon Sep 17 00:00:00 2001 From: Fu Matthew Date: Thu, 27 Dec 2012 15:05:24 +0800 Subject: [PATCH 2/2] fix disappear widget inter block --- app/models/page.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/models/page.rb b/app/models/page.rb index d13b403ad..eb2ba7992 100644 --- a/app/models/page.rb +++ b/app/models/page.rb @@ -31,13 +31,14 @@ class Page < Item protected def create_parts + page_design = self.design parent = self.parent menu_part = parent.page_parts.detect{|page_part| page_part.kind.eql?('public_r_tag') && page_part.public_r_tag.eql?('sub_menu') && page_part.public_r_tag_object_id.eql?(parent.id.to_s)} if parent page_design.layout.layout_parts.each do |layout_part| current_part = self.page_parts.detect{|page_part| page_part.name.eql?(layout_part.name)} current_part = self.page_parts.build(:name => layout_part.name) unless current_part - if menu_part && current_part.name.eql?(menu_part.name) + if current_part.name.eql?(menu_part.name) && menu_part if current_part.new_record? current_part.kind = menu_part.kind current_part.public_r_tag = menu_part.public_r_tag @@ -50,6 +51,10 @@ class Page < Item current_part.update_attributes(:kind => menu_part.kind, :public_r_tag => menu_part.public_r_tag, :public_r_tag_object_id => menu_part.public_r_tag_object_id) end end + else + if current_part.new_record? + current_part.save + end end end end