Skip to content

Instantly share code, notes, and snippets.

@mrpunkin
Created September 17, 2012 20:11
Show Gist options
  • Save mrpunkin/3739499 to your computer and use it in GitHub Desktop.
Save mrpunkin/3739499 to your computer and use it in GitHub Desktop.
class Comment < ActiveRecord::Base
has_one :photo_invite
has_one :critique
def attachment
if photo_invite and photo_invite.invited_to
photo_invite
elsif critique then critique
else nil
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment