5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
# File 'app/helpers/refinery/admin/dashboard_helper.rb', line 5
def activity_message_for(record)
if (plugin = Refinery::Plugins.active.find_by_model(record.class)) &&
(activity = plugin.activity_by_class_name(record.class.name).first)
action = record.updated_at.eql?(record.created_at) ? 'created' : 'updated'
article = t('article', :scope => "refinery.plugins.#{plugin.name}.", :default => 'the')
link_to t('.latest_activity_message',
:what => record.send(activity.title),
:kind => record.class.model_name.human,
:action => t("with_article \"#{article}\"", :scope => "refinery.#{action}")
).downcase.capitalize, eval("#{activity.url}(#{activity.nesting("record")})")
end
end
|