Skip to content
Merged
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
5 changes: 5 additions & 0 deletions db/migrate/20160528065150_remove_rubygems_downloads.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class RemoveRubygemsDownloads < ActiveRecord::Migration
def change
remove_column :rubygems, :downloads, :integer
end
end
11 changes: 1 addition & 10 deletions db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema.define(version: 20160527190738) do
ActiveRecord::Schema.define(version: 20160528065150) do

# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
Expand Down Expand Up @@ -152,7 +152,6 @@
t.string "name"
t.datetime "created_at"
t.datetime "updated_at"
t.integer "downloads", default: 0
t.string "slug"
end

Expand Down Expand Up @@ -192,14 +191,6 @@
add_index "users", ["remember_token"], name: "index_users_on_remember_token", using: :btree
add_index "users", ["token"], name: "index_users_on_token", using: :btree

create_table "version_histories", force: :cascade do |t|
t.integer "version_id"
t.date "day"
t.integer "count"
end

add_index "version_histories", ["version_id", "day"], name: "index_version_histories_on_version_id_and_day", unique: true, using: :btree

create_table "versions", force: :cascade do |t|
t.text "authors"
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry about this. In #1285 I had forgotten to run the migration 😭

t.text "description"
Expand Down
38 changes: 18 additions & 20 deletions doc/erd.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions test/factories.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
transient do
owners []
number nil
downloads 0
end

linkset
Expand Down
5 changes: 2 additions & 3 deletions test/unit/user_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,8 @@ class UserTest < ActiveSupport::TestCase
context "rubygems" do
setup do
@user = create(:user)
@rubygems = [[100, 2000], [200, 1000], [300, 3000]].map do |downloads, real_downloads|
create(:rubygem, downloads: downloads).tap do |rubygem|
GemDownload.find_by(rubygem_id: rubygem.id, version_id: 0).update(count: real_downloads)
@rubygems = [2000, 1000, 3000].map do |download|
create(:rubygem, downloads: download).tap do |rubygem|
create(:ownership, rubygem: rubygem, user: @user)
create(:version, rubygem: rubygem)
end
Expand Down