assemblymade/coderwall

View on GitHub
app/badges/hackathon.rb

Summary

Maintainability
A
0 mins
Test Coverage
class Hackathon < BadgeBase
  describe "Hackathon",
           description: "Participated in a hackathon.",
           for:         "participating in a hackathon.",
           image_name:  'hackathon.png'

  def reasons
    @reasons ||= begin
      links = []
      user.facts.each do |fact|
        if fact.tagged?('hackathon', 'inperson') && !fact.tagged?('university')
          links << { fact.name => fact.url }
        end
      end
      { links: links }
    end
  end
end