Commit e49775305bcd0935f83961ba6932819fe5c10541

Authored by Karpikau Andrei
1 parent 0f21d9c5

check domain as global variable

... ... @@ -31,7 +31,7 @@ module Kanjai
31 31 content = item[:source]
32 32 if current_page
33 33 content = content.gsub('###link###', current_page.menu_url('http://', lang = nil))
34   - .gsub('###title###', current_page.lang_attributes($domain.page_langs.default, :title))
  34 + .gsub('###title###', current_page.lang_attributes(domain.page_langs.default, :title))
35 35 end
36 36 subparts << content
37 37 when 'repeat'
... ... @@ -68,7 +68,7 @@ module Kanjai
68 68 end
69 69
70 70
71   - page_collection = Page.joins(:domain).where(kanjai_domains: {id: $domain.id}).order(:position)
  71 + page_collection = Page.joins(:domain).where(kanjai_domains: {id: domain.id}).order(:position)
72 72
73 73 if item[:attributes]["ids"].present?
74 74 page_collection = page_collection.where('id in (?)', item[:attributes]["ids"])
... ... @@ -147,7 +147,7 @@ module Kanjai
147 147 elements.each do |item|
148 148 case item[:name]
149 149 when 'text'
150   - lang = $domain.page_langs.find_by_code($current_locale)
  150 + lang = domain.page_langs.find_by_code($current_locale)
151 151 content = item[:source]
152 152 content = content.gsub('###CURRENT_LANG_TITLE###', lang.title)
153 153 .gsub('###CURRENT_LANG_CODE###', lang.code)
... ... @@ -178,7 +178,7 @@ module Kanjai
178 178 if page_data
179 179 page = page_data.page
180 180 end
181   - $domain.page_langs.all.each do |lang|
  181 + domain.page_langs.all.each do |lang|
182 182 if lang.code.to_s == $current_locale.to_s && active_state_template
183 183 content = active_state_template.gsub('###LANG_CODE###', lang.code)
184 184 .gsub('###LANG_TITLE###', lang.title)
... ...
1 1 module Kanjai
2   - VERSION = "0.0.212"
  2 + VERSION = "0.0.213"
3 3 end
... ...