Skip to content

Commit 98c930c

Browse files
authored
Deps: upgrade ActiveRecord to 6.1 (stringer-rss#566)
I needed to update the format of the json being returned in the tests. I'm not sure if it actually ends up changing the result when the dates are converted to JSON strings, but it doesn't look like anything client or server relies particularly on the format, so we should be fine. Also updates the formatting in `schema.rb` by running `rake db:migrate`. All of the changes look to be cosmetic.
1 parent 2e978fc commit 98c930c

File tree

4 files changed

+50
-54
lines changed

4 files changed

+50
-54
lines changed

Gemfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ group :development, :test do
2727
gem "timecop"
2828
end
2929

30-
gem "activerecord", "~> 5.0"
30+
gem "activerecord"
3131
gem "bcrypt"
3232
gem "delayed_job"
3333
gem "delayed_job_active_record"

Gemfile.lock

+15-16
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,19 @@
11
GEM
22
remote: https://rubygems.org/
33
specs:
4-
activemodel (5.2.4.5)
5-
activesupport (= 5.2.4.5)
6-
activerecord (5.2.4.5)
7-
activemodel (= 5.2.4.5)
8-
activesupport (= 5.2.4.5)
9-
arel (>= 9.0)
10-
activesupport (5.2.4.5)
4+
activemodel (6.1.3.1)
5+
activesupport (= 6.1.3.1)
6+
activerecord (6.1.3.1)
7+
activemodel (= 6.1.3.1)
8+
activesupport (= 6.1.3.1)
9+
activesupport (6.1.3.1)
1110
concurrent-ruby (~> 1.0, >= 1.0.2)
12-
i18n (>= 0.7, < 2)
13-
minitest (~> 5.1)
14-
tzinfo (~> 1.1)
11+
i18n (>= 1.6, < 2)
12+
minitest (>= 5.1)
13+
tzinfo (~> 2.0)
14+
zeitwerk (~> 2.3)
1515
addressable (2.7.0)
1616
public_suffix (>= 2.0.2, < 5.0)
17-
arel (9.0.0)
1817
ast (2.4.2)
1918
bcrypt (3.1.16)
2019
byebug (11.1.3)
@@ -55,7 +54,7 @@ GEM
5554
httparty (0.18.1)
5655
mime-types (~> 3.0)
5756
multi_xml (>= 0.5.2)
58-
i18n (1.8.9)
57+
i18n (1.8.10)
5958
concurrent-ruby (~> 1.0)
6059
json (2.5.1)
6160
kgio (2.11.3)
@@ -184,13 +183,12 @@ GEM
184183
tins (~> 1.0)
185184
thor (1.1.0)
186185
thread (0.2.2)
187-
thread_safe (0.3.6)
188186
tilt (2.0.10)
189187
timecop (0.9.4)
190188
tins (1.28.0)
191189
sync
192-
tzinfo (1.2.9)
193-
thread_safe (~> 0.1)
190+
tzinfo (2.0.4)
191+
concurrent-ruby (~> 1.0)
194192
uglifier (4.2.0)
195193
execjs (>= 0.3.0, < 3)
196194
unicode-display_width (2.0.0)
@@ -200,12 +198,13 @@ GEM
200198
will_paginate (3.3.0)
201199
xpath (3.2.0)
202200
nokogiri (~> 1.8)
201+
zeitwerk (2.4.2)
203202

204203
PLATFORMS
205204
ruby
206205

207206
DEPENDENCIES
208-
activerecord (~> 5.0)
207+
activerecord
209208
bcrypt
210209
capybara
211210
coveralls (> 0.8)

db/schema.rb

+31-34
Original file line numberDiff line numberDiff line change
@@ -2,75 +2,72 @@
22
# of editing this file, please use the migrations feature of Active Record to
33
# incrementally modify your database, and then regenerate this schema definition.
44
#
5-
# Note that this schema.rb definition is the authoritative source for your
6-
# database schema. If you need to create the application database on another
7-
# system, you should be using db:schema:load, not running all the migrations
8-
# from scratch. The latter is a flawed and unsustainable approach (the more migrations
9-
# you'll amass, the slower it'll run and the greater likelihood for issues).
5+
# This file is the source Rails uses to define your schema when running `bin/rails
6+
# db:schema:load`. When creating a new database, `bin/rails db:schema:load` tends to
7+
# be faster and is potentially less error prone than running all of your
8+
# migrations from scratch. Old migrations may fail to apply correctly if those
9+
# migrations use external dependencies or application code.
1010
#
1111
# It's strongly recommended that you check this file into your version control system.
1212

13-
ActiveRecord::Schema.define(version: 20141102103617) do
13+
ActiveRecord::Schema.define(version: 2014_11_02_103617) do
1414

1515
# These are extensions that must be enabled in order to support this database
1616
enable_extension "plpgsql"
1717

1818
create_table "delayed_jobs", force: :cascade do |t|
19-
t.integer "priority", default: 0
20-
t.integer "attempts", default: 0
21-
t.text "handler"
22-
t.text "last_error"
19+
t.integer "priority", default: 0
20+
t.integer "attempts", default: 0
21+
t.text "handler"
22+
t.text "last_error"
2323
t.datetime "run_at"
2424
t.datetime "locked_at"
2525
t.datetime "failed_at"
26-
t.string "locked_by"
27-
t.string "queue"
26+
t.string "locked_by"
27+
t.string "queue"
2828
t.datetime "created_at"
2929
t.datetime "updated_at"
30+
t.index ["priority", "run_at"], name: "delayed_jobs_priority"
3031
end
3132

32-
add_index "delayed_jobs", ["priority", "run_at"], name: "delayed_jobs_priority", using: :btree
33-
3433
create_table "feeds", force: :cascade do |t|
35-
t.string "name"
36-
t.text "url"
34+
t.string "name"
35+
t.text "url"
3736
t.datetime "last_fetched"
3837
t.datetime "created_at"
3938
t.datetime "updated_at"
40-
t.integer "status"
41-
t.integer "group_id"
39+
t.integer "status"
40+
t.integer "group_id"
41+
t.index ["url"], name: "index_feeds_on_url", unique: true
4242
end
4343

44-
add_index "feeds", ["url"], name: "index_feeds_on_url", unique: true, using: :btree
45-
4644
create_table "groups", force: :cascade do |t|
47-
t.string "name", null: false
45+
t.string "name", null: false
4846
t.datetime "created_at", null: false
4947
t.datetime "updated_at", null: false
5048
end
5149

5250
create_table "stories", force: :cascade do |t|
53-
t.text "title"
54-
t.text "permalink"
55-
t.text "body"
56-
t.integer "feed_id"
51+
t.text "title"
52+
t.text "permalink"
53+
t.text "body"
54+
t.integer "feed_id"
5755
t.datetime "created_at"
5856
t.datetime "updated_at"
5957
t.datetime "published"
60-
t.boolean "is_read"
61-
t.boolean "keep_unread", default: false
62-
t.boolean "is_starred", default: false
63-
t.text "entry_id"
58+
t.boolean "is_read"
59+
t.boolean "keep_unread", default: false
60+
t.boolean "is_starred", default: false
61+
t.text "entry_id"
62+
t.index ["entry_id", "feed_id"], name: "index_stories_on_entry_id_and_feed_id", unique: true
6463
end
6564

66-
add_index "stories", ["entry_id", "feed_id"], name: "index_stories_on_entry_id_and_feed_id", unique: true, using: :btree
67-
6865
create_table "users", force: :cascade do |t|
69-
t.string "password_digest"
66+
t.string "password_digest"
7067
t.datetime "created_at"
7168
t.datetime "updated_at"
72-
t.boolean "setup_complete"
73-
t.string "api_key"
69+
t.boolean "setup_complete"
70+
t.string "api_key"
7471
end
7572

7673
end

spec/models/story_spec.rb

+3-3
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@
8484

8585
expect(story.as_json).to eq({
8686
body: "story body",
87-
created_at: created_at,
87+
created_at: created_at.utc.as_json,
8888
entry_id: "5",
8989
feed_id: feed.id,
9090
headline: "the story title",
@@ -95,10 +95,10 @@
9595
lead: "story body",
9696
permalink: "www.exampoo.com/perma",
9797
pretty_date: I18n.l(published_at.utc),
98-
published: published_at.utc,
98+
published: published_at.utc.as_json,
9999
source: "my feed",
100100
title: "the story title",
101-
updated_at: updated_at
101+
updated_at: updated_at.utc.as_json
102102
}.stringify_keys)
103103
end
104104
end

0 commit comments

Comments
 (0)