Permalink
Browse files

Merge pull request #26 from thomas88/fix-relation-all-deprecation

Relation#all is deprecated in Rails 4, use Relation#to_a instead
  • Loading branch information...
2 parents fafd54e + 386c6af commit ded2750a23b17fb6c021fb05321a2e7c4b51dd8e @cmer committed Aug 7, 2013
View
@@ -1,6 +1,5 @@
language: ruby
rvm:
- - 1.9.2
- 1.9.3
- 2.0.0
@@ -66,7 +66,7 @@ def followers_relation(followable, klass, opts = {})
def followers(followable, klass, opts = {})
rel = followers_relation(followable, klass, opts)
if rel.is_a?(ActiveRecord::Relation)
- rel.all
+ rel.to_a
else
rel
end
@@ -92,7 +92,7 @@ def followables_relation(follower, klass, opts = {})
def followables(follower, klass, opts = {})
rel = followables_relation(follower, klass, opts)
if rel.is_a?(ActiveRecord::Relation)
- rel.all
+ rel.to_a
else
rel
end
@@ -66,7 +66,7 @@ def likers_relation(likeable, klass, opts = {})
def likers(likeable, klass, opts = {})
rel = likers_relation(likeable, klass, opts)
if rel.is_a?(ActiveRecord::Relation)
- rel.all
+ rel.to_a
else
rel
end
@@ -92,7 +92,7 @@ def likeables_relation(liker, klass, opts = {})
def likeables(liker, klass, opts = {})
rel = likeables_relation(liker, klass, opts)
if rel.is_a?(ActiveRecord::Relation)
- rel.all
+ rel.to_a
else
rel
end
@@ -66,7 +66,7 @@ def mentioners_relation(mentionable, klass, opts = {})
def mentioners(mentionable, klass, opts = {})
rel = mentioners_relation(mentionable, klass, opts)
if rel.is_a?(ActiveRecord::Relation)
- rel.all
+ rel.to_a
else
rel
end
@@ -92,7 +92,7 @@ def mentionables_relation(mentioner, klass, opts = {})
def mentionables(mentioner, klass, opts = {})
rel = mentionables_relation(mentioner, klass, opts)
if rel.is_a?(ActiveRecord::Relation)
- rel.all
+ rel.to_a
else
rel
end
@@ -11,7 +11,7 @@ def actors(victim, klass, options = {})
result
end
else
- actors_relation(victim, klass, options).all
+ actors_relation(victim, klass, options).to_a
end
end
@@ -32,7 +32,7 @@ def victims(actor, klass, options = {})
result
end
else
- victims_relation(actor, klass, options).all
+ victims_relation(actor, klass, options).to_a
end
end

0 comments on commit ded2750

Please sign in to comment.