Sha256: 6919af34b8c5de4b60e61cdaaf909171e188999c1f569be719011695ec554e13
Contents?: true
Size: 954 Bytes
Versions: 32
Compression:
Stored size: 954 Bytes
Contents
module Admin module DashboardHelper def activity_message_for(record) plugin = Refinery::Plugins.active.find_by_model(record.class) if (activity = plugin.activity.first).present? # work out which action occured action = record.updated_at.eql?(record.created_at) ? "created" : "updated" # get article to define gender of model name, some languages require this for proper grammar article = t('article', :scope => "plugins.#{plugin.name}.", :default => 'the') # now create a link to the notification's corresponding record. link_to t(".latest_activity_message", :what => record.send(activity.title), :kind => record.class.model_name.human, :action => t("with_article \"#{article}\"", :scope => action) ).downcase.capitalize, eval("#{activity.url}(#{activity.nesting("record")}record)") end end end end
Version data entries
32 entries across 32 versions & 2 rubygems