Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/models/linkset.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
class Linkset < ActiveRecord::Base
belongs_to :rubygem

LINKS = %w(home code docs wiki mail bugs).freeze
LINKS = %w(home changelog code docs wiki mail bugs).freeze

LINKS.each do |url|
validates_formatting_of url.to_sym,
Expand Down
1 change: 1 addition & 0 deletions app/models/rubygem.rb
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ def payload(version = versions.most_recent, protocol = Gemcutter::PROTOCOL, host
'mailing_list_uri' => versioned_links.mailing_list_uri,
'source_code_uri' => versioned_links.source_code_uri,
'bug_tracker_uri' => versioned_links.bug_tracker_uri,
'changelog_uri' => versioned_links.changelog_uri,
'dependencies' => {
'development' => deps.select { |r| r.rubygem && 'development' == r.scope },
'runtime' => deps.select { |r| r.rubygem && 'runtime' == r.scope }
Expand Down
2 changes: 2 additions & 0 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ en:
links:
badge: Badge
bugs: Bug Tracker
changelog: Change Log
code: Source Code
docs: Documentation
download: Download
Expand Down Expand Up @@ -224,6 +225,7 @@ en:
versions_since: "%{count} versions since %{since}"
version:
yanked: yanked

will_paginate:
next_label: Next
page_gap: "…"
Expand Down
5 changes: 5 additions & 0 deletions db/migrate/20151109014752_add_changelog_to_linksets.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class AddChangelogToLinksets < ActiveRecord::Migration
def change
add_column :linksets, :changelog, :string
end
end
3 changes: 2 additions & 1 deletion db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema.define(version: 20161231080902) do

# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
enable_extension "hstore"
Expand Down Expand Up @@ -81,6 +81,7 @@
t.string "bugs"
t.datetime "created_at"
t.datetime "updated_at"
t.string "changelog"
end

add_index "linksets", ["rubygem_id"], name: "index_linksets_on_rubygem_id", using: :btree
Expand Down
1 change: 1 addition & 0 deletions test/factories.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
mail 'http://example.com'
code 'http://example.com'
bugs 'http://example.com'
changelog 'http://example.com'
end

factory :ownership do
Expand Down
2 changes: 2 additions & 0 deletions test/unit/rubygem_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,7 @@ class RubygemTest < ActiveSupport::TestCase
assert_equal @rubygem.linkset.mail, hash["mailing_list_uri"]
assert_equal @rubygem.linkset.code, hash["source_code_uri"]
assert_equal @rubygem.linkset.bugs, hash["bug_tracker_uri"]
assert_equal @rubygem.linkset.bugs, hash["changelog_uri"]
end

should "return version documentation uri if linkset docs is empty" do
Expand All @@ -525,6 +526,7 @@ class RubygemTest < ActiveSupport::TestCase
assert_equal @rubygem.linkset.mail, doc.at_css("mailing-list-uri").content
assert_equal @rubygem.linkset.code, doc.at_css("source-code-uri").content
assert_equal @rubygem.linkset.bugs, doc.at_css("bug-tracker-uri").content
assert_equal @rubygem.linkset.changelog, doc.at_css("changelog-uri").content
end
end
end
Expand Down