Skip to content

Instantly share code, notes, and snippets.

@abacha
Created March 11, 2013 20:18
Show Gist options
  • Select an option

  • Save abacha/5137369 to your computer and use it in GitHub Desktop.

Select an option

Save abacha/5137369 to your computer and use it in GitHub Desktop.
def mail
if !activity_type.public || activity_type.private_fields.count > 0
ActivityMailer.delay.report(id, true)
end
if activity_type.public
public_fields = self.values.select { |value| value.field.public && !value.blank? }
ActivityMailer.delay.report(id, false) unless public_fields.empty?
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment