app/models/group.rb in social_stream-0.3.4 vs app/models/group.rb in social_stream-0.3.5
- old
+ new
@@ -7,14 +7,20 @@
end
after_create :create_founder
after_create :create_participants
-
+ def recent_groups
+ subjects(:subject_type => :group, :direction => :receivers) do |q|
+ q.select("ties.created_at").
+ merge(Tie.recent)
+ end
+ end
+
private
- #Creates the ties betwbeen the group and the founder
+ #Creates the ties between the group and the founder
def create_founder
founder =
Actor.find_by_permalink(_founder) || raise("Cannot create group without founder")
sent_ties.create! :receiver => founder,
@@ -26,13 +32,12 @@
return if @_participants.blank?
@_participants.each do |participant|
- participantActor = Actor.find_by_id(participant.to_i)
- sent_ties.create! :receiver => participantActor,
+ participant_actor = Actor.find_by_id(participant.to_i)
+
+ sent_ties.create! :receiver => participant_actor,
:relation => relations.sort.first
end
-
end
-
-end
\ No newline at end of file
+end