lib/public_activity/common.rb
# Prepares settings used during creation of Activity record.
# params passed directly to tracked model have priority over
# settings specified in tracked() method
#
# @see #create_activity
# @return [Hash] Settings with preserved options that were passed
# @api private
# @overload prepare_settings(action, options = {})
#   @see #create_activity
# @overload prepare_settings(options = {})
#   @see #create_activity
Prepares settings used during creation of Activity record.
params passed directly to tracked model have priority over
settings specified in tracked() method
Prepares settings used during creation of Activity record . params passed directly to tracked model have priority over settings specified in tracked () method
def prepare_settings(*args)
      raw_options = args.extract_options!
      action      = [args.first, raw_options.delete(:action)].compact.first
      key         = prepare_key(action, raw_options)
      raise NoKeyProvided, "No key provided for #{self.class.name}" unless key
      prepare_custom_fields(raw_options.except(:params)).merge(
        {
          key:        key,
          owner:      prepare_relation(:owner,     raw_options),
          recipient:  prepare_relation(:recipient, raw_options),
          parameters: prepare_parameters(raw_options),
        }
      )
    end
def prepare_settings ( * args ) raw_options = args . extract_options! action = [ args . first , raw_options . delete ( :action ) ] . compact . first key = prepare_key ( action , raw_options ) raise NoKeyProvided , "No key provided for #{self.class.name}" unless key prepare_custom_fields ( raw_options . except ( :params ) ) . merge ( { key : key , owner : prepare_relation ( :owner , raw_options ) , recipient : prepare_relation ( :recipient , raw_options ) , parameters : prepare_parameters ( raw_options ) , } ) end
Prepares settings used during creation of Activity record.
Prepares settings used during creation of Activity record .
Settings with preserved options that were passed
Settings with preserved options that were passed
Hash
args
<not_specific>
see
None
api
None
overload
prepare_settings(action, options = {}) @see #create_activity
prepare_settings ( action options = {} ) @see #create_activity
overload
prepare_settings(options = {}) @see #create_activity
prepare_settings ( options = {} ) @see #create_activity