Merge branch 'design_team' of https://github.com/Rulingcom/orbit into design_team
Conflicts: vendor/built_in_modules/news/app/helpers/panel/news/back_end/news_bulletins_helper.rb
This commit is contained in:
commit
661fcafe70
|
@ -1,7 +1,7 @@
|
||||||
class Admin::AdBannersController < OrbitBackendController
|
class Admin::AdBannersController < OrbitBackendController
|
||||||
layout "new_admin"
|
layout "new_admin"
|
||||||
before_filter :authenticate_user!
|
before_filter :authenticate_user!
|
||||||
before_filter :for_app_manager,:except => [:index,:show]
|
before_filter :for_app_manager,:except => [:index,:show,:update,:realtime_preview]
|
||||||
before_filter :for_app_sub_manager
|
before_filter :for_app_sub_manager
|
||||||
|
|
||||||
def rename
|
def rename
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
class Admin::AdImagesController < ApplicationController
|
class Admin::AdImagesController < OrbitBackendController
|
||||||
layout 'new_admin'
|
layout 'new_admin'
|
||||||
before_filter :authenticate_user!
|
before_filter :authenticate_user!
|
||||||
before_filter :is_admin?
|
before_filter :for_app_sub_manager
|
||||||
|
|
||||||
def edit
|
def edit
|
||||||
@ad_banner = AdBanner.find params[:ad_banner_id]
|
@ad_banner = AdBanner.find params[:ad_banner_id]
|
||||||
|
|
|
@ -17,7 +17,6 @@ class Admin::AssetCategoriesController < OrbitBackendController
|
||||||
|
|
||||||
def edit
|
def edit
|
||||||
@asset_category = AssetCategory.find(params[:id])
|
@asset_category = AssetCategory.find(params[:id])
|
||||||
@i18n_variable = @asset_category.i18n_variable
|
|
||||||
@url = admin_asset_categories_path(@asset_category)
|
@url = admin_asset_categories_path(@asset_category)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,7 @@ class Admin::DashboardsController < ApplicationController
|
||||||
module_app_class = module_app.classify.constantize
|
module_app_class = module_app.classify.constantize
|
||||||
objects = module_app_class.order_by(:updated_at, :desc).limit(10)
|
objects = module_app_class.order_by(:updated_at, :desc).limit(10)
|
||||||
objects.each do |object|
|
objects.each do |object|
|
||||||
a.merge!(object => object.updated_at)
|
a.merge!(object => object.updated_at) unless (object.archived rescue nil)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
sorted_objects = a.sort {|a,b| b[1]<=>a[1]}
|
sorted_objects = a.sort {|a,b| b[1]<=>a[1]}
|
||||||
|
@ -43,7 +43,7 @@ class Admin::DashboardsController < ApplicationController
|
||||||
module_app_class = module_app.classify.constantize
|
module_app_class = module_app.classify.constantize
|
||||||
objects = module_app_class.order_by(:view_count, :desc).limit(10)
|
objects = module_app_class.order_by(:view_count, :desc).limit(10)
|
||||||
objects.each do |object|
|
objects.each do |object|
|
||||||
a.merge!(object => object.view_count) if object.view_count > 0
|
a.merge!(object => object.view_count) if object.view_count > 0 && (!object.archived rescue true)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
sorted_objects = a.sort {|a,b| b[1]<=>a[1]}
|
sorted_objects = a.sort {|a,b| b[1]<=>a[1]}
|
||||||
|
|
|
@ -21,7 +21,6 @@ class Admin::InfosController < ApplicationController
|
||||||
|
|
||||||
def edit
|
def edit
|
||||||
@attribute = Info.find(params[:id])
|
@attribute = Info.find(params[:id])
|
||||||
@i18n_variable = @attribute.i18n_variable
|
|
||||||
render :template => 'admin/attributes/edit'
|
render :template => 'admin/attributes/edit'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,6 @@ class Admin::RolesController < ApplicationController
|
||||||
|
|
||||||
def edit
|
def edit
|
||||||
@attribute = Role.find(params[:id])
|
@attribute = Role.find(params[:id])
|
||||||
@i18n_variable = @attribute.i18n_variable
|
|
||||||
render :template => 'admin/attributes/edit'
|
render :template => 'admin/attributes/edit'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -181,7 +181,7 @@ module ApplicationHelper
|
||||||
end
|
end
|
||||||
|
|
||||||
def display_visitors(options={})
|
def display_visitors(options={})
|
||||||
Impression.where(options).distinct(:session_hash).count
|
Impression.where(options).and(:referrer.ne => nil).distinct(:session_hash).count
|
||||||
end
|
end
|
||||||
|
|
||||||
def display_visitors_today
|
def display_visitors_today
|
||||||
|
|
|
@ -7,6 +7,10 @@
|
||||||
<%= f.select :ad_fx ,AdBanner::FX_TYPES %>
|
<%= f.select :ad_fx ,AdBanner::FX_TYPES %>
|
||||||
<%= f.label :transition_sec, t('admin.ad.transition_sec') %>
|
<%= f.label :transition_sec, t('admin.ad.transition_sec') %>
|
||||||
<%= f.text_field :transition_sec,:placeholder=>t('admin.ad.sec_place_holder'),:class=> "span3" %> <%= t("admin.ad.trans_unit_sec") %>
|
<%= f.text_field :transition_sec,:placeholder=>t('admin.ad.sec_place_holder'),:class=> "span3" %> <%= t("admin.ad.trans_unit_sec") %>
|
||||||
|
<%if at_least_module_manager%>
|
||||||
|
<%= f.label :best_size, t('admin.ad.best_size') %>
|
||||||
|
<%= f.text_field :best_size %> Ex: 500px x 300px
|
||||||
|
<% end -%>
|
||||||
<br>
|
<br>
|
||||||
<%= f.submit t("admin.ad.update_banner"), :class => 'btn' %>
|
<%= f.submit t("admin.ad.update_banner"), :class => 'btn' %>
|
||||||
<%= f.submit t("cancel"),:type=>'reset', :class => 'btn' %>
|
<%= f.submit t("cancel"),:type=>'reset', :class => 'btn' %>
|
||||||
|
|
|
@ -22,6 +22,13 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="control-group">
|
||||||
|
<%= f.label :best_size, t('admin.ad.best_size'),:class => "control-label" %>
|
||||||
|
<div class="controls">
|
||||||
|
<%= f.text_field :best_size %> Ex: 500px x 300px
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="control-group">
|
<div class="control-group">
|
||||||
<%= f.label :ad_fx, t('admin.ad.ab_fx') %>
|
<%= f.label :ad_fx, t('admin.ad.ab_fx') %>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
|
|
|
@ -13,11 +13,16 @@
|
||||||
<ul id="banner_tab" class="nav nav-tabs">
|
<ul id="banner_tab" class="nav nav-tabs">
|
||||||
<% @ad_banners.each do |ab| %>
|
<% @ad_banners.each do |ab| %>
|
||||||
<%= content_tag :li ,:class => (ab == @active ? 'active' : nil) do %>
|
<%= content_tag :li ,:class => (ab == @active ? 'active' : nil) do %>
|
||||||
<i class="icons-pencil"></i>
|
<%if at_least_module_manager%>
|
||||||
<%= link_to(ab.title,"##{ab.title.dehumanize}",:contenteditable=>"false",:data=>{:toggle=>"tab" ,'edit-url' =>(admin_rename_ad_banner_path ab) } )%>
|
<i class="icons-pencil"></i>
|
||||||
|
<%= link_to(ab.title,"##{ab.title.dehumanize}",:contenteditable=>"false",:data=>{:toggle=>"tab" ,'edit-url' =>(admin_rename_ad_banner_path ab) } )%>
|
||||||
|
<% else %>
|
||||||
|
<%= link_to(ab.title,"##{ab.title.dehumanize}",:data=>{:toggle=>"tab" } )%>
|
||||||
|
<% end -%>
|
||||||
<% end -%>
|
<% end -%>
|
||||||
<% end -%>
|
<% end -%>
|
||||||
<%= content_tag :li,link_to(t("admin.ad.new_banner"),"#new-a-banner",:data=>{:toggle=>"modal"}),:id=>'new_ad_banner_tab_but',:class => (@active.nil? ? 'active' : nil ) %>
|
|
||||||
|
<%= content_tag :li,link_to(t("admin.ad.new_banner"),"#new-a-banner",:data=>{:toggle=>"modal"}),:id=>'new_ad_banner_tab_but',:class => (@active.nil? ? 'active' : nil ) if at_least_module_manager%>
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
|
|
|
@ -80,7 +80,10 @@
|
||||||
<!--請程式務必將圖片尺寸加入到行內裡-->
|
<!--請程式務必將圖片尺寸加入到行內裡-->
|
||||||
<%= image_tag @ad_image.file rescue ''%>
|
<%= image_tag @ad_image.file rescue ''%>
|
||||||
</div>
|
</div>
|
||||||
<span class="alert widgetInfo"><%= t("admin.ad.widget_info_for_ad_image_size",:best_size=> @ad_image.ad_banner.best_size) if !@ad_image.ad_banner.best_size.empty?%></span>
|
<% if !@ad_image.ad_banner.best_size.empty?%>
|
||||||
|
<span class="alert widgetInfo"><%= t("admin.ad.widget_info_for_ad_image_size",:best_size=> @ad_image.ad_banner.best_size) %>
|
||||||
|
</span>
|
||||||
|
<% end -%>
|
||||||
<div class="controls file-upload input-prepend">
|
<div class="controls file-upload input-prepend">
|
||||||
<label class="control-label add-on btn" for="input-upload">
|
<label class="control-label add-on btn" for="input-upload">
|
||||||
<%= t(:browse) %>
|
<%= t(:browse) %>
|
||||||
|
|
|
@ -91,6 +91,7 @@ en:
|
||||||
ab_fx: FX
|
ab_fx: FX
|
||||||
all_banners: AdBanner list
|
all_banners: AdBanner list
|
||||||
banner_best_size: Banner Best Size
|
banner_best_size: Banner Best Size
|
||||||
|
best_size: Best size
|
||||||
new_banner: New banner
|
new_banner: New banner
|
||||||
new_image: New image
|
new_image: New image
|
||||||
showing: Showing
|
showing: Showing
|
||||||
|
|
|
@ -85,6 +85,7 @@ zh_tw:
|
||||||
ab_fx: 轉場特效
|
ab_fx: 轉場特效
|
||||||
all_banners: 輪播清單
|
all_banners: 輪播清單
|
||||||
banner_best_size: Banner 尺寸
|
banner_best_size: Banner 尺寸
|
||||||
|
best_size: 最佳尺寸
|
||||||
cate_auth: 分類授權
|
cate_auth: 分類授權
|
||||||
delete_banner: 刪除整組輪播
|
delete_banner: 刪除整組輪播
|
||||||
new_banner: 新增輪播
|
new_banner: 新增輪播
|
||||||
|
|
|
@ -55,7 +55,6 @@ class Panel::Announcement::BackEnd::BulletinCategorysController < OrbitBackendCo
|
||||||
# GET /bulletins/1/edit
|
# GET /bulletins/1/edit
|
||||||
def edit
|
def edit
|
||||||
@bulletin_category = BulletinCategory.find(params[:id])
|
@bulletin_category = BulletinCategory.find(params[:id])
|
||||||
@i18n_variable = @bulletin_category.i18n_variable
|
|
||||||
|
|
||||||
@url = panel_announcement_back_end_bulletin_category_path(@bulletin_category)
|
@url = panel_announcement_back_end_bulletin_category_path(@bulletin_category)
|
||||||
|
|
||||||
|
|
|
@ -45,7 +45,7 @@ class Panel::Announcement::BackEnd::BulletinsController < OrbitBackendController
|
||||||
|
|
||||||
if(!is_admin? || !is_manager?)
|
if(!is_admin? || !is_manager?)
|
||||||
@bulletins.delete_if{ |bulletin|
|
@bulletins.delete_if{ |bulletin|
|
||||||
bulletin.is_pending == true && (!bulletin.bulletin_category.authed_users('fact_check').include?(current_user) || bulletin.create_user_id!=current_user.id)
|
bulletin.is_pending == true && ((!bulletin.bulletin_category.authed_users('fact_check').include?(current_user) rescue nil) || bulletin.create_user_id!=current_user.id)
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@ module Panel::Announcement::BackEnd::BulletinsHelper
|
||||||
|
|
||||||
def show_approval_link(bulletin)
|
def show_approval_link(bulletin)
|
||||||
by_bulletin = (!bulletin.is_expired? and !bulletin.is_checked?)
|
by_bulletin = (!bulletin.is_expired? and !bulletin.is_checked?)
|
||||||
by_user = (bulletin.bulletin_category.authed_users('fact_check').include?(current_user) or is_manager? or is_admin?)
|
by_user = ((bulletin.bulletin_category.authed_users('fact_check').include?(current_user) rescue nil) or is_manager? or is_admin?)
|
||||||
by_bulletin and by_user
|
by_bulletin and by_user
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -28,7 +28,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td><%= bulletin.bulletin_category.i18n_variable[I18n.locale] %></td>
|
<td><%= bulletin.bulletin_category.i18n_variable[I18n.locale] rescue nil %></td>
|
||||||
<td>
|
<td>
|
||||||
<%= link_to bulletin.title[I18n.locale], panel_announcement_front_end_bulletin_path(bulletin, :category_id => bulletin.bulletin_category.id) rescue ''%>
|
<%= link_to bulletin.title[I18n.locale], panel_announcement_front_end_bulletin_path(bulletin, :category_id => bulletin.bulletin_category.id) rescue ''%>
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
<b><%= t('announcement.category') %></b>
|
<b><%= t('announcement.category') %></b>
|
||||||
<%= @bulletin.bulletin_category.i18n_variable[I18n.locale] %>
|
<%= @bulletin.bulletin_category.i18n_variable[I18n.locale] rescue nil %>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<b><%= t('announcement.postdate') %></b>
|
<b><%= t('announcement.postdate') %></b>
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
|
|
||||||
<% @bulletins.each do |post| %>
|
<% @bulletins.each do |post| %>
|
||||||
<tr>
|
<tr>
|
||||||
<td><%= post.bulletin_category.i18n_variable[I18n.locale] %></td>
|
<td><%= post.bulletin_category.i18n_variable[I18n.locale] rescue nil %></td>
|
||||||
<td><%= link_to post.title[I18n.locale], panel_announcement_front_end_bulletin_path(post, :category_id => post.bulletin_category_id) %>
|
<td><%= link_to post.title[I18n.locale], panel_announcement_front_end_bulletin_path(post, :category_id => post.bulletin_category_id) %>
|
||||||
<%#= link_to post.title, panel_announcement_back_end_bulletin_path(post) %>
|
<%#= link_to post.title, panel_announcement_back_end_bulletin_path(post) %>
|
||||||
</td>
|
</td>
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
|
|
||||||
<% @bulletins.each do |post| %>
|
<% @bulletins.each do |post| %>
|
||||||
<tr>
|
<tr>
|
||||||
<td><%= post.bulletin_category.i18n_variable[I18n.locale] %></td>
|
<td><%= post.bulletin_category.i18n_variable[I18n.locale] rescue nil %></td>
|
||||||
<td><%= link_to post.title[I18n.locale], panel_announcement_front_end_bulletin_path(post, :category_id => post.bulletin_category_id) %>
|
<td><%= link_to post.title[I18n.locale], panel_announcement_front_end_bulletin_path(post, :category_id => post.bulletin_category_id) %>
|
||||||
</td>
|
</td>
|
||||||
<td><%= post.postdate %></td>
|
<td><%= post.postdate %></td>
|
||||||
|
|
|
@ -56,7 +56,6 @@ class Panel::News::BackEnd::NewsBulletinCategorysController < OrbitBackendContro
|
||||||
# GET /news_bulletins/1/edit
|
# GET /news_bulletins/1/edit
|
||||||
def edit
|
def edit
|
||||||
@news_bulletin_category = NewsBulletinCategory.find(params[:id])
|
@news_bulletin_category = NewsBulletinCategory.find(params[:id])
|
||||||
@i18n_variable = @news_bulletin_category.i18n_variable
|
|
||||||
|
|
||||||
@url = panel_news_back_end_news_bulletin_category_path(@news_bulletin_category)
|
@url = panel_news_back_end_news_bulletin_category_path(@news_bulletin_category)
|
||||||
|
|
||||||
|
|
|
@ -43,7 +43,7 @@ class Panel::News::BackEnd::NewsBulletinsController < OrbitBackendController
|
||||||
@link_url = panel_news_back_end_news_bulletins_path
|
@link_url = panel_news_back_end_news_bulletins_path
|
||||||
|
|
||||||
@news_bulletins.delete_if{ |news_bulletin|
|
@news_bulletins.delete_if{ |news_bulletin|
|
||||||
news_bulletin.is_pending == true && (!news_bulletin.bulletin_category.authed_users('fact_check').include?(current_user) || news_bulletin.create_user_id!=current_user.id)
|
news_bulletin.is_pending == true && ((!news_bulletin.bulletin_category.authed_users('fact_check').include?(current_user) rescue nil) || news_bulletin.create_user_id!=current_user.id)
|
||||||
}
|
}
|
||||||
|
|
||||||
@news_bulletin_file = NewsBulletinFile.new
|
@news_bulletin_file = NewsBulletinFile.new
|
||||||
|
|
|
@ -28,7 +28,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td><%= news_bulletin.news_bulletin_category.i18n_variable[I18n.locale] %></td>
|
<td><%= news_bulletin.news_bulletin_category.i18n_variable[I18n.locale] rescue nil %></td>
|
||||||
<td>
|
<td>
|
||||||
<%= link_to news_bulletin.title[I18n.locale], panel_news_front_end_news_bulletin_path(news_bulletin, :category_id => news_bulletin.news_bulletin_category.id) rescue ''%>
|
<%= link_to news_bulletin.title[I18n.locale], panel_news_front_end_news_bulletin_path(news_bulletin, :category_id => news_bulletin.news_bulletin_category.id) rescue ''%>
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
<b><%= t('news.category') %></b>
|
<b><%= t('news.category') %></b>
|
||||||
<%= @news_bulletin.news_bulletin_category.i18n_variable[I18n.locale] %>
|
<%= @news_bulletin.news_bulletin_category.i18n_variable[I18n.locale] rescue nil %>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<b><%= t('news.postdate') %></b>
|
<b><%= t('news.postdate') %></b>
|
||||||
|
|
|
@ -38,7 +38,6 @@ class Panel::WebResource::BackEnd::WebLinkCategorysController < OrbitBackendCont
|
||||||
# GET /web_links/1/edit
|
# GET /web_links/1/edit
|
||||||
def edit
|
def edit
|
||||||
@web_link_category = WebLinkCategory.find(params[:id])
|
@web_link_category = WebLinkCategory.find(params[:id])
|
||||||
@i18n_variable = @web_link_category.i18n_variable
|
|
||||||
|
|
||||||
@url = panel_web_resource_back_end_web_link_category_path(@web_link_category)
|
@url = panel_web_resource_back_end_web_link_category_path(@web_link_category)
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td><%= web_link.web_link_category.i18n_variable[I18n.locale] %></td>
|
<td><%= web_link.web_link_category.i18n_variable[I18n.locale] rescue nil %></td>
|
||||||
<td>
|
<td>
|
||||||
<%= link_to web_link.name[I18n.locale], panel_web_resource_back_end_web_link_path(web_link) %>
|
<%= link_to web_link.name[I18n.locale], panel_web_resource_back_end_web_link_path(web_link) %>
|
||||||
<div class="quick-edit">
|
<div class="quick-edit">
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
<b><%= t('announcement.category') %></b>
|
<b><%= t('announcement.category') %></b>
|
||||||
<%= @bulletin.bulletin_category.i18n_variable[I18n.locale] %>
|
<%= @bulletin.bulletin_category.i18n_variable[I18n.locale] rescue nil %>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<b><%= t('announcement.postdate') %></b>
|
<b><%= t('announcement.postdate') %></b>
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
|
|
||||||
<% @web_links.each do |post| %>
|
<% @web_links.each do |post| %>
|
||||||
<tr>
|
<tr>
|
||||||
<td><%= post.web_link_category.i18n_variable[I18n.locale] %></td>
|
<td><%= post.web_link_category.i18n_variable[I18n.locale] rescue nil %></td>
|
||||||
<td>
|
<td>
|
||||||
<%#= link_to post.name[I18n.locale], panel_web_resource_front_end_web_link_path(post) %>
|
<%#= link_to post.name[I18n.locale], panel_web_resource_front_end_web_link_path(post) %>
|
||||||
<%= link_to post.name[I18n.locale], post.url, {:target => '_blank', :title => post.name[I18n.locale]} %>
|
<%= link_to post.name[I18n.locale], post.url, {:target => '_blank', :title => post.name[I18n.locale]} %>
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
<b><%= t('announcement.category') %></b>
|
<b><%= t('announcement.category') %></b>
|
||||||
<%= @bulletin.bulletin_category.i18n_variable[I18n.locale] %>
|
<%= @bulletin.bulletin_category.i18n_variable[I18n.locale] rescue nil %>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<b><%= t('announcement.postdate') %></b>
|
<b><%= t('announcement.postdate') %></b>
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
</tr>
|
</tr>
|
||||||
<% @web_links.each do |post| %>
|
<% @web_links.each do |post| %>
|
||||||
<tr>
|
<tr>
|
||||||
<td><%= post.web_link_category.i18n_variable[I18n.locale] %></td>
|
<td><%= post.web_link_category.i18n_variable[I18n.locale] rescue nil %></td>
|
||||||
<td>
|
<td>
|
||||||
<%= link_to post.name[I18n.locale], post.url, {:target => '_blank', :title => post.name[I18n.locale]} %>
|
<%= link_to post.name[I18n.locale], post.url, {:target => '_blank', :title => post.name[I18n.locale]} %>
|
||||||
</td>
|
</td>
|
||||||
|
|
|
@ -27,11 +27,13 @@ class Impression
|
||||||
private
|
private
|
||||||
|
|
||||||
def update_impressions_counter_cache
|
def update_impressions_counter_cache
|
||||||
impressionable_class = self.impressionable_type.constantize
|
if self.referrer
|
||||||
|
impressionable_class = self.impressionable_type.constantize
|
||||||
|
|
||||||
if impressionable_class.impressionist_counter_cache_options
|
if impressionable_class.impressionist_counter_cache_options
|
||||||
resouce = impressionable_class.find(self.impressionable_id)
|
resouce = impressionable_class.find(self.impressionable_id)
|
||||||
resouce.try(:update_impressionist_counter_cache)
|
resouce.try(:update_impressionist_counter_cache)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue