Sha256: 716f2fc1c16b0aa3d9e4c6a27c72e3a108d931f5a123fa945c188ec5022bfedc
Contents?: true
Size: 881 Bytes
Versions: 11
Compression:
Stored size: 881 Bytes
Contents
module Admin::DashboardHelper def activity_message_for(record) unless (activity = Refinery::Plugins.active.find_activity_by_model(record.class)).nil? or activity.title.blank? title = eval "record.#{activity.title}" link = link_to truncate(title, :length => 45), eval("#{activity.url_prefix}admin_#{record.class.name.underscore.downcase}_url(record)"), :title => "See '#{title}'" # next work out which action occured and how long ago it happened action = record.updated_at.eql?(record.created_at) ? "created" : "updated" message = "<td>#{refinery_icon_tag("#{eval("activity.#{action}_image")}")}</td>" message << "<td>#{link} #{record.class.name.titleize.downcase} was #{action}</td>" message << "<td class='time_ago'>#{time_ago_in_words(eval("record.#{action}_at")).gsub("about ", "")} ago</td>" end end end
Version data entries
11 entries across 11 versions & 1 rubygems