forked from spen/seminar
Fix bug.
This commit is contained in:
parent
3fb9d052ac
commit
751f26c24c
|
@ -223,6 +223,11 @@ class SeminarMain
|
||||||
self.save(:validate=>false) if save_flag
|
self.save(:validate=>false) if save_flag
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
after_destroy do
|
||||||
|
Thread.new do
|
||||||
|
Page.where(:bind_model=>self.class.to_s,:bind_uid=>self.uid).destroy
|
||||||
|
end
|
||||||
|
end
|
||||||
def self.time_range(date1 = null, date2 = null)
|
def self.time_range(date1 = null, date2 = null)
|
||||||
|
|
||||||
if !date1.blank?
|
if !date1.blank?
|
||||||
|
|
|
@ -1,5 +1,17 @@
|
||||||
Rails.application.routes.draw do
|
Rails.application.routes.draw do
|
||||||
|
Thread.new do
|
||||||
|
if Page.fields.include?('all_pageids')
|
||||||
|
s = Site.first
|
||||||
|
if s.respond_to?(:tmp_flags) && !(s.tmp_flags.include?('fix_sr'))
|
||||||
|
Page.where(:bind_model=>"SeminarMain",:all_pageids=>nil).each do |p|
|
||||||
|
p.save
|
||||||
|
end
|
||||||
|
tmp_flags = s.tmp_flags
|
||||||
|
tmp_flags << 'fix_sr'
|
||||||
|
Site.update_all(:tmp_flags => tmp_flags)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
locales = Site.first.in_use_locales rescue I18n.available_locales
|
locales = Site.first.in_use_locales rescue I18n.available_locales
|
||||||
|
|
||||||
scope "(:locale)", locale: Regexp.new(locales.join("|")) do
|
scope "(:locale)", locale: Regexp.new(locales.join("|")) do
|
||||||
|
|
Loading…
Reference in New Issue