diff --git a/app/controllers/admin/links_controller.rb b/app/controllers/admin/links_controller.rb index 923435cad..99d8dca71 100644 --- a/app/controllers/admin/links_controller.rb +++ b/app/controllers/admin/links_controller.rb @@ -43,7 +43,7 @@ class Admin::LinksController < Admin::ItemsController m = {} m["public"] = link.is_published ? 1 : 0 m["link"] = @site_valid_locales.inject([]) do |result, locale| - result << [locale, (link.enabled_for && link.enabled_for.include?(locale)) ? 1 : 0, (link.menu_enabled_for && link.menu_enabled_for[locale]) ? 1 :0] + result << [locale, (link.enabled_for && link.enabled_for.include?(locale)) ? 1 : 0, (link.menu_enabled_for && link.menu_enabled_for[locale].eql?("true")) ? 1 :0] end render json: JSON.pretty_generate(m) rescue diff --git a/app/controllers/admin/pages_controller.rb b/app/controllers/admin/pages_controller.rb index b08f89169..320b8e9aa 100644 --- a/app/controllers/admin/pages_controller.rb +++ b/app/controllers/admin/pages_controller.rb @@ -64,7 +64,7 @@ class Admin::PagesController < Admin::ItemsController m["tags"] = page.tag.present? ? [0, page.tag.map{|c| c.to_s}] : [1] m["public"] = page.is_published ? 1 : 0 m["link"] = @site_valid_locales.inject([]) do |link, locale| - link << [locale, (page.enabled_for && page.enabled_for.include?(locale)) ? 1 : 0, (page.menu_enabled_for && page.menu_enabled_for[locale]) ? 1 :0] + link << [locale, (page.enabled_for && page.enabled_for.include?(locale)) ? 1 : 0, (page.menu_enabled_for && page.menu_enabled_for[locale].eql?('true')) ? 1 :0] end m["count"] = page.frontend_data_count render json: JSON.pretty_generate({design: design, module: m}) diff --git a/app/models/item.rb b/app/models/item.rb index ee2653e8d..b9ee2da71 100644 --- a/app/models/item.rb +++ b/app/models/item.rb @@ -38,7 +38,7 @@ class Item a = [] if objects objects.each do |object| - a << object if object.menu_enabled_for.nil? ? true : object.menu_enabled_for.include?(I18n.locale.to_s) + a << object if object.menu_enabled_for.nil? ? true : object.menu_enabled_for[I18n.locale.to_s].eql?("true") end end a