fix error
This commit is contained in:
parent
53ab1b77bd
commit
162094a798
|
@ -136,6 +136,8 @@ class Admin::CalendarsController < OrbitAdminController
|
||||||
if !bulletin.nil?
|
if !bulletin.nil?
|
||||||
bulletin.update_attributes(calendar_start_date: p1[:start],calendar_end_date: p1[:end],calendar_all_day: p1[:all_day],calendar_type_id: p1[:calendar_type_id])
|
bulletin.update_attributes(calendar_start_date: p1[:start],calendar_end_date: p1[:end],calendar_all_day: p1[:all_day],calendar_type_id: p1[:calendar_type_id])
|
||||||
end
|
end
|
||||||
|
p1['title_translations'] = @event['title_translations'].merge({I18n.locale.to_s =>p1['title']})
|
||||||
|
p1['note_translations'] = @event['title_translations'].merge({I18n.locale.to_s =>p1['note']})
|
||||||
if @event.update_attributes(p1)
|
if @event.update_attributes(p1)
|
||||||
e = @event.to_json
|
e = @event.to_json
|
||||||
e = JSON.parse(e)
|
e = JSON.parse(e)
|
||||||
|
|
|
@ -57,10 +57,6 @@ class Event
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
before_save do
|
|
||||||
self['title_translations'] = self['title_translations'].merge({I18n.locale.to_s =>self['title']})
|
|
||||||
self['note_translations'] = self['title_translations'].merge({I18n.locale.to_s =>self['note']})
|
|
||||||
end
|
|
||||||
########################################
|
########################################
|
||||||
validates_presence_of :title, :message => "Please fill the title of the Event", :if => lambda { self['title_translations'].blank? }
|
validates_presence_of :title, :message => "Please fill the title of the Event", :if => lambda { self['title_translations'].blank? }
|
||||||
validates_presence_of :title_translations, :message => "Please fill the title of the Event", :if => lambda { self['title'].blank? }
|
validates_presence_of :title_translations, :message => "Please fill the title of the Event", :if => lambda { self['title'].blank? }
|
||||||
|
|
Loading…
Reference in New Issue