lib/public_activity/common.rb
def prepare_key(action, options = {})
      (
        options[:key] ||
        self.activity_key ||
        ((self.class.name.underscore.gsub('/', '_') + "." + action.to_s) if action)
      ).try(:to_s)
    end
# Helper method to serialize class name into relevant key
# @return [String] the resulted key
# @param [Symbol] or [String] the name of the operation to be done on class
# @param [Hash] options to be used on key generation, defaults to {}
Helper method to serialize class name into relevant key
Helper method to serialize class name into relevant key
def prepare_key(action, options = {})
      (
        options[:key] ||
        self.activity_key ||
        ((self.class.name.underscore.gsub('/', '_') + "." + action.to_s) if action)
      ).try(:to_s)
    end
def prepare_key ( action , options = { } ) ( options [ :key ] || self . activity_key || ( ( self . class . name . underscore . gsub ( '/' , '_' ) + "." + action . to_s ) if action ) ) . try ( :to_s ) end
Helper method to serialize class name into relevant key
Helper method to serialize class name into relevant key
the resulted key
the resulted key
String
action
options
options to be used on key generation, defaults to {}
options to be used on key generation defaults to {}
{}