app/models/person.rb
# NOTE: opting into a team implies becoming global bounty hunter
opting into a team implies becoming global bounty hunter
opting into a team implies becoming global bounty hunter
def is_bounty_hunter!(options={})
    update_attribute(:bounty_hunter, true)
    teams = []
    if options[:team]
      teams << options[:team]
    elsif options[:issue]
      teams += Team.where(id: options[:issue].bounties.where(owner_type: 'Team').pluck(:owner_id))
    end
    teams.each do |team|
      tbh = team_bounty_hunters.where(team: team).first_or_create!
      tbh.update_attributes!(opted_out_at: nil) if tbh.opted_out_at
    end
  end
def is_bounty_hunter! ( options = { } ) update_attribute ( :bounty_hunter , true ) teams = [ ] if options [ :team ] teams << options [ :team ] elsif options [ :issue ] teams += Team . where ( id : options [ :issue ] . bounties . where ( owner_type : 'Team' ) . pluck ( :owner_id ) ) end teams . each do | team | tbh = team_bounty_hunters . where ( team : team ) . first_or_create! tbh . update_attributes! ( opted_out_at : nil ) if tbh . opted_out_at end end
NOTE: opting into a team implies becoming global bounty hunter
NOTE : opting into a team implies becoming global bounty hunter
options