From 96fc4789d9991548b9fd1144f185da1f3464f156 Mon Sep 17 00:00:00 2001 From: Stefan Wintermeyer Date: Tue, 15 Jan 2013 21:47:26 +0100 Subject: Fixed caching bugs. --- app/views/tenants/_admin_area.de.html.haml | 2 +- app/views/tenants/_admin_area.html.haml | 2 +- app/views/tenants/_sip_accounts_and_phones.html.haml | 4 ++-- app/views/tenants/_table_of_phone_books.html.haml | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) (limited to 'app/views/tenants') diff --git a/app/views/tenants/_admin_area.de.html.haml b/app/views/tenants/_admin_area.de.html.haml index 4b8a9e6..beab94e 100644 --- a/app/views/tenants/_admin_area.de.html.haml +++ b/app/views/tenants/_admin_area.de.html.haml @@ -1,4 +1,4 @@ -- cache([I18n.locale, @tenant, UserGroup.count, UserGroup.order(:updated_at).last, User.count, User.order(:updated_at).last, Manufacturer.all]) do +- cache(['tenant_show_admin_area', I18n.locale, @tenant, UserGroup.count, UserGroup.order(:updated_at).last, User.count, User.order(:updated_at).last, Manufacturer.all]) do %p Sie sind Mitglied der = link_to 'Admin Gruppe', tenant_user_group_path(@tenant, @tenant.user_groups.find_by_name('Admins')) diff --git a/app/views/tenants/_admin_area.html.haml b/app/views/tenants/_admin_area.html.haml index b1b17a3..65810e7 100644 --- a/app/views/tenants/_admin_area.html.haml +++ b/app/views/tenants/_admin_area.html.haml @@ -1,4 +1,4 @@ -- cache([I18n.locale, @tenant, UserGroup.count, UserGroup.order(:updated_at).last, User.count, User.order(:updated_at).last, Manufacturer.all]) do +- cache(['tenant_show_admin_area', I18n.locale, @tenant, UserGroup.count, UserGroup.order(:updated_at).last, User.count, User.order(:updated_at).last, Manufacturer.all]) do %p You belong to the = link_to 'admin group', tenant_user_group_path(@tenant, @tenant.user_groups.find_by_name('Admins')) diff --git a/app/views/tenants/_sip_accounts_and_phones.html.haml b/app/views/tenants/_sip_accounts_and_phones.html.haml index 618236f..c698fef 100644 --- a/app/views/tenants/_sip_accounts_and_phones.html.haml +++ b/app/views/tenants/_sip_accounts_and_phones.html.haml @@ -12,7 +12,7 @@ - if tenant.sip_accounts.count > GsParameter.get('NUMBER_OF_SHOWN_ITEMS') = link_to tenant.sip_accounts.count.to_s, tenant_sip_accounts_path(tenant) - else - - cache([I18n.locale, tenant, tenant.sip_accounts, PhoneNumber.where(:phone_numberable_type => 'SipAccount').where(:id => tenant.sip_account_ids)]) do + - cache(['tenant_show_tenant_sip_accounts',I18n.locale, tenant, tenant.sip_accounts, PhoneNumber.where(:phone_numberable_type => 'SipAccount').where(:id => tenant.sip_account_ids)]) do - tenant.sip_accounts.each do |sip_account| = succeed ', ' do =link_to "#{sip_account.caller_name}", tenant_sip_account_path(tenant,sip_account) @@ -44,7 +44,7 @@ - if tenant.phones.count > GsParameter.get('NUMBER_OF_SHOWN_ITEMS') = link_to tenant.phones.count.to_s, tenant_phones_path(tenant) - else - - cache([I18n.locale, tenant, tenant.phones]) do + - cache(['tenant_show_tenant_phones', I18n.locale, tenant, tenant.phones]) do - tenant.phones.each do |phone| = succeed ', ' do = link_to "#{phone.phone_model.to_s} (#{phone.pretty_mac_address})#{(phone.ip_address.blank? ? '' : " - #{phone.ip_address}")}", tenant_phone_path(tenant, phone) diff --git a/app/views/tenants/_table_of_phone_books.html.haml b/app/views/tenants/_table_of_phone_books.html.haml index a963bf4..6baca58 100644 --- a/app/views/tenants/_table_of_phone_books.html.haml +++ b/app/views/tenants/_table_of_phone_books.html.haml @@ -1,4 +1,4 @@ -- cache([I18n.locale, tenant, tenant.phone_books]) do +- cache(['user_show_phone_books', I18n.locale, tenant, tenant.phone_books]) do -# Phone books -# - if GuiFunction.display?('show_phone_books_in_user_show_view', current_user) -- cgit v1.2.3