Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

18 lines (13 sloc) 0.478 kb
class Linkset < ActiveRecord::Base
belongs_to :rubygem
LINKS = %w(home wiki docs mail code bugs).freeze
LINKS.each do |url|
validates_formatting_of url.to_sym, :using => :url, :allow_nil => true, :allow_blank => true, :message => "does not appear to be a valid URL"
end
def empty?
LINKS.map { |link| attributes[link] }.all?(&:blank?)
end
def update_attributes_from_gem_specification!(spec)
self.update_attributes!(:home => spec.homepage)
end
end
Jump to Line
Something went wrong with that request. Please try again.