Skip to content

Commit 60342b6

Browse files
committed
Updated to ActiveRecord 4
1 parent 2a80389 commit 60342b6

6 files changed

Lines changed: 32 additions & 25 deletions

File tree

‎Gemfile‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ group :heroku do
2727
gem "rendezvous", "~> 0.0.2"
2828
end
2929

30-
gem "activerecord", "~> 3.1"
31-
gem "bcrypt-ruby", "~> 3.0.0"
30+
gem "activerecord", "~> 4.0"
31+
gem "bcrypt-ruby", "~> 3.1.2"
3232
gem "delayed_job_active_record", "~> 4.0"
3333
gem "feedbag", github: "dwillis/feedbag"
3434
gem "feedzirra", github: "swanson/feedzirra"
@@ -38,7 +38,7 @@ gem "loofah", github: "swanson/loofah"
3838
gem "nokogiri", "~> 1.5.11"
3939
gem "racksh", "~> 1.0"
4040
gem "rake", "~> 10.1", ">= 10.1.1"
41-
gem "sinatra", "~> 1.4", ">= 1.4.4", require: false
41+
gem "sinatra", "~> 1.4", ">= 1.4.4"
4242
gem "sinatra-assetpack", "~> 0.3.1", require: "sinatra/assetpack"
4343
gem "sinatra-activerecord", "~> 1.2", ">= 1.2.3"
4444
gem "sinatra-contrib", github: "sinatra/sinatra-contrib"

‎Gemfile.lock‎

Lines changed: 23 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -37,21 +37,26 @@ GIT
3737
GEM
3838
remote: https://rubygems.org/
3939
specs:
40-
activemodel (3.2.16)
41-
activesupport (= 3.2.16)
42-
builder (~> 3.0.0)
43-
activerecord (3.2.16)
44-
activemodel (= 3.2.16)
45-
activesupport (= 3.2.16)
46-
arel (~> 3.0.2)
47-
tzinfo (~> 0.3.29)
48-
activesupport (3.2.16)
40+
activemodel (4.0.2)
41+
activesupport (= 4.0.2)
42+
builder (~> 3.1.0)
43+
activerecord (4.0.2)
44+
activemodel (= 4.0.2)
45+
activerecord-deprecated_finders (~> 1.0.2)
46+
activesupport (= 4.0.2)
47+
arel (~> 4.0.0)
48+
activerecord-deprecated_finders (1.0.3)
49+
activesupport (4.0.2)
4950
i18n (~> 0.6, >= 0.6.4)
50-
multi_json (~> 1.0)
51-
arel (3.0.3)
51+
minitest (~> 4.2)
52+
multi_json (~> 1.3)
53+
thread_safe (~> 0.1)
54+
tzinfo (~> 0.3.37)
55+
arel (4.0.1)
56+
atomic (1.1.14)
5257
backports (3.3.5)
53-
bcrypt-ruby (3.0.1)
54-
builder (3.0.4)
58+
bcrypt-ruby (3.1.2)
59+
builder (3.1.4)
5560
byebug (2.5.0)
5661
columnize (~> 0.3.6)
5762
debugger-linecache (~> 1.2.0)
@@ -86,6 +91,7 @@ GEM
8691
kgio (2.8.1)
8792
method_source (0.8.2)
8893
mime-types (2.0)
94+
minitest (4.7.5)
8995
multi_json (1.8.2)
9096
netrc (0.7.7)
9197
nokogiri (1.5.11)
@@ -150,6 +156,8 @@ GEM
150156
tins (~> 0.8)
151157
thor (0.18.1)
152158
thread (0.1.3)
159+
thread_safe (0.1.3)
160+
atomic
153161
tilt (1.4.1)
154162
tins (0.13.1)
155163
tzinfo (0.3.38)
@@ -163,8 +171,8 @@ PLATFORMS
163171
ruby
164172

165173
DEPENDENCIES
166-
activerecord (~> 3.1)
167-
bcrypt-ruby (~> 3.0.0)
174+
activerecord (~> 4.0)
175+
bcrypt-ruby (~> 3.1.2)
168176
coveralls (~> 0.7)
169177
delayed_job_active_record (~> 4.0)
170178
excon (~> 0.31.0)

‎Rakefile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
require "bundler"
2-
Bundler.require
2+
Bundler.setup
33

44
require "rubygems"
55
require "net/http"

‎app/models/feed.rb‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
class Feed < ActiveRecord::Base
2-
has_many :stories, order: "published desc" , dependent: :delete_all
2+
has_many :stories, -> {order "published desc"} , dependent: :delete_all
33

44
validates_uniqueness_of :url
55

‎app/models/user.rb‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
class User < ActiveRecord::Base
2-
attr_accessible :setup_complete, :api_key
3-
4-
attr_accessible :password, :password_confirmation
2+
# attr_accessible :setup_complete, :api_key
3+
# attr_accessible :password, :password_confirmation
54
has_secure_password
65

76
def setup_complete?
87
setup_complete
98
end
10-
end
9+
end

‎spec/support/active_record.rb‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
ActiveRecord::Base.establish_connection(config['test'])
55

66
def need_to_migrate?
7-
ActiveRecord::Migrator.new(:up, 'db/migrate').pending_migrations.any?
7+
ActiveRecord::Migrator.new(:up, ActiveRecord::Migrator.migrations('db/migrate')).pending_migrations.any?
88
end
99

1010
if need_to_migrate?

0 commit comments

Comments
 (0)