Skip to content

Instantly share code, notes, and snippets.

@tensiondriven
Created July 7, 2014 19:06
Show Gist options
  • Save tensiondriven/f9ff7b2cf721a4c51fbb to your computer and use it in GitHub Desktop.
Save tensiondriven/f9ff7b2cf721a4c51fbb to your computer and use it in GitHub Desktop.
def self.create_for_referral_viewed(referral)
first_or_create({
user: referral.opportunity.owner,
name: 'view',
actable: referral,
actor: referral.redeemed_by # may be nil, can't count on it being there
})
end
# Hey Jose - should first_or_create take some criteria? What criteria is this using?
activity.rb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment