Skip to content
Extraits de code Groupes Projets
Valider 2cca5745 rédigé par Jonne Haß's avatar Jonne Haß
Parcourir les fichiers

remove deprecated scoped

parent cb195f4d
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -85,7 +85,7 @@ class Post < ActiveRecord::Base ...@@ -85,7 +85,7 @@ class Post < ActiveRecord::Base
def self.excluding_blocks(user) def self.excluding_blocks(user)
people = user.blocks.map{|b| b.person_id} people = user.blocks.map{|b| b.person_id}
scope = scoped scope = all
if people.any? if people.any?
scope = scope.where("posts.author_id NOT IN (?)", people) scope = scope.where("posts.author_id NOT IN (?)", people)
...@@ -95,7 +95,7 @@ class Post < ActiveRecord::Base ...@@ -95,7 +95,7 @@ class Post < ActiveRecord::Base
end end
def self.excluding_hidden_shareables(user) def self.excluding_hidden_shareables(user)
scope = scoped scope = all
if user.has_hidden_shareables_of_type? if user.has_hidden_shareables_of_type?
scope = scope.where('posts.id NOT IN (?)', user.hidden_shareables["#{self.base_class}"]) scope = scope.where('posts.id NOT IN (?)', user.hidden_shareables["#{self.base_class}"])
end end
......
...@@ -144,8 +144,8 @@ class Profile < ActiveRecord::Base ...@@ -144,8 +144,8 @@ class Profile < ActiveRecord::Base
if @tag_string if @tag_string
@tag_string @tag_string
else else
rows = self.class.connection.select_rows( self.tags.scoped.to_sql ) tags = self.tags.pluck(:name)
rows.inject(""){|string, row| string << "##{row[1]} " } tags.inject(""){|string, tag| string << "##{tag} " }
end end
end end
......
...@@ -32,7 +32,7 @@ class Stream::Base ...@@ -32,7 +32,7 @@ class Stream::Base
# @return [ActiveRecord::Relation<Post>] # @return [ActiveRecord::Relation<Post>]
def posts def posts
Post.scoped Post.all
end end
# @return [Array<Post>] # @return [Array<Post>]
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter