Skip to content

Commit

Permalink
Fix bug about Group#recent_groups
Browse files Browse the repository at this point in the history
  • Loading branch information
atd committed Mar 1, 2011
1 parent 212f8c5 commit d790c7f
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions app/models/group.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,15 @@ def followers
after_create :create_founder
after_create :create_participants


def recent_groups
subjects(:subject_type => :group, :direction => :receivers) do |q|
q.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")
Expand All @@ -28,11 +33,10 @@ def create_participants

@_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
end

0 comments on commit d790c7f

Please sign in to comment.