You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In ActiveRecord::FriendModel, in the instance methods, calling operator + on 2 relations force loading all rows from database to merge the 2 relations.
Exemple: lib / amistad / active_record / friend_model.rb line 68-70:
def friends
self.invited(true) + self.invited_by(true)
end
The friends method returns an Array instead of an ActiveRecord::Relation object and it's not possible anymore to chain any ActiveRecord query method like offset, limit and order.
Is it possible to update the gem and use the method merge from ActiveRecord::SpawnMethods to merge the two Relation objects and get a new one ?
def friends
self.invited(true).merge self.invited_by(true)
end
The text was updated successfully, but these errors were encountered:
I am working on it. Thank you for your suggestion.
Le 5 juil. 2011 à 12:10, kmatrah a écrit :
In ActiveRecord::FriendModel, in the instance methods, calling operator + on 2 relations force loading all rows from database to merge the 2 relations.
Exemple: lib / amistad / active_record / friend_model.rb line 68-70:
def friends
self.invited(true) + self.invited_by(true)
end
The friends method returns an Array instead of an ActiveRecord::Relation object and it's not possible anymore to chain any ActiveRecord query method like offset, limit and order.
Is it possible to update the gem and use the method merge from ActiveRecord::SpawnMethods to merge the two Relation objects and get a new one ?
def friends
self.invited(true).merge self.invited_by(true)
end
Reply to this email directly or view it on GitHub: #12
In ActiveRecord::FriendModel, in the instance methods, calling operator + on 2 relations force loading all rows from database to merge the 2 relations.
Exemple: lib / amistad / active_record / friend_model.rb line 68-70:
def friends
self.invited(true) + self.invited_by(true)
end
The friends method returns an Array instead of an ActiveRecord::Relation object and it's not possible anymore to chain any ActiveRecord query method like offset, limit and order.
Is it possible to update the gem and use the method merge from ActiveRecord::SpawnMethods to merge the two Relation objects and get a new one ?
def friends
self.invited(true).merge self.invited_by(true)
end
The text was updated successfully, but these errors were encountered: