Commit 6591bcb48804e7e00682391d61821ef95699848f
1 parent
34d3a283
Exists in
master
and in
27 other branches
Fixing identation and missing brace on person.rb
Showing
1 changed file
with
6 additions
and
6 deletions
Show diff stats
app/models/person.rb
| ... | ... | @@ -25,7 +25,7 @@ class Person < Profile |
| 25 | 25 | scope :not_members_of, lambda { |resources| |
| 26 | 26 | resources = [resources] if !resources.kind_of?(Array) |
| 27 | 27 | conditions = resources.map {|resource| "role_assignments.resource_type = '#{resource.class.base_class.name}' AND role_assignments.resource_id = #{resource.id || -1}"}.join(' OR ') |
| 28 | - { :select => 'DISTINCT profiles.*', :conditions => ['"profiles"."id" NOT IN (SELECT DISTINCT profiles.id FROM "profiles" INNER JOIN "role_assignments" ON "role_assignments"."accessor_id" = "profiles"."id" AND "role_assignments"."accessor_type" = (\'Profile\') WHERE "profiles"."type" IN (\'Person\') AND (%s))' % conditions] | |
| 28 | + { :select => 'DISTINCT profiles.*', :conditions => ['"profiles"."id" NOT IN (SELECT DISTINCT profiles.id FROM "profiles" INNER JOIN "role_assignments" ON "role_assignments"."accessor_id" = "profiles"."id" AND "role_assignments"."accessor_type" = (\'Profile\') WHERE "profiles"."type" IN (\'Person\') AND (%s))' % conditions] } | |
| 29 | 29 | } |
| 30 | 30 | |
| 31 | 31 | scope :by_role, lambda { |roles| |
| ... | ... | @@ -64,9 +64,9 @@ roles] } |
| 64 | 64 | ScopeTool.union *scopes |
| 65 | 65 | end |
| 66 | 66 | |
| 67 | - def memberships_by_role(role) | |
| 68 | - memberships.where('role_assignments.role_id = ?', role.id) | |
| 69 | - end | |
| 67 | + def memberships_by_role(role) | |
| 68 | + memberships.where('role_assignments.role_id = ?', role.id) | |
| 69 | + end | |
| 70 | 70 | |
| 71 | 71 | has_many :friendships, :dependent => :destroy |
| 72 | 72 | has_many :friends, :class_name => 'Person', :through => :friendships |
| ... | ... | @@ -141,12 +141,12 @@ roles] } |
| 141 | 141 | end |
| 142 | 142 | |
| 143 | 143 | def add_friend(friend, group = nil) |
| 144 | - unless self.is_a_friend?(friend) | |
| 144 | + unless self.is_a_friend?(friend) | |
| 145 | 145 | friendship = self.friendships.build |
| 146 | 146 | friendship.friend = friend |
| 147 | 147 | friendship.group = group |
| 148 | 148 | friendship.save |
| 149 | - end | |
| 149 | + end | |
| 150 | 150 | end |
| 151 | 151 | |
| 152 | 152 | def already_request_friendship?(person) | ... | ... |