fix translations error for new mongoid
This commit is contained in:
parent
6ca8a557f0
commit
bffe78ed13
|
@ -69,14 +69,14 @@ class SiteFeed
|
|||
site_feed_annc.update_remote_site_url if site_feed_annc
|
||||
end
|
||||
def sync_data_to_annc(site_feed_annc=nil)
|
||||
category_title = self.category[:title] rescue {}
|
||||
category_title = self.category.title_translations rescue {}
|
||||
tmp_channel_title = self.channel_title_for_cache
|
||||
clone_fields =["channel_key", "merge_with_category", "remote_site_url", "feeds_model", "feeds_uid_field", "feeds_update_callback", "feeds_time_field", "feeds_update_statuses_callback"]
|
||||
(site_feed_annc ? [site_feed_annc] : SiteFeedAnnc.where(:feed_id=>self.id)).each do |tmp|
|
||||
clone_fields.each do |f|
|
||||
tmp.send("#{f}=", self.send(f))
|
||||
end
|
||||
tmp[:feed_name] = self[:feed_name]
|
||||
tmp[:feed_name] = self.feed_name_translations
|
||||
tmp.category_title = category_title
|
||||
tmp.channel_title = tmp_channel_title
|
||||
tmp.save
|
||||
|
@ -193,7 +193,7 @@ class SiteFeed
|
|||
Category.find(self.merge_with_category) rescue nil
|
||||
end
|
||||
def channel_title_for_cache #empty? must for hash
|
||||
!self[:channel_title].blank? ? self[:channel_title] : {}#I18n.available_locales.collect{|v| [v,I18n.t("feed.source")]}.to_h
|
||||
!self.channel_title_translations.blank? ? self.channel_title_translations : {}#I18n.available_locales.collect{|v| [v,I18n.t("feed.source")]}.to_h
|
||||
end
|
||||
def http_request(http, request)
|
||||
response = http.request(request)
|
||||
|
|
Loading…
Reference in New Issue