#692: small refactoring according to Alexander's comments

This commit is contained in:
Vokhmin Alexey V 2012-10-16 20:36:59 +04:00
parent c36ae5413b
commit e5af275c3a
2 changed files with 3 additions and 7 deletions

View File

@ -28,8 +28,7 @@ class Api::V1::GroupsController < Api::V1::BaseController
end
def create
@group = Group.new params[:group]
@group.owner = current_user
@group = current_user.own_groups.new params[:group]
create_subject @group
end

View File

@ -33,11 +33,8 @@ class Relation < ActiveRecord::Base
end
def self.remove_member(member, target)
if target.try(:owner) == member
false
else
Relation.by_actor(member).by_target(target).each{|r| r.destroy}
end
return false if target.try(:owner) == member
Relation.by_actor(member).by_target(target).each{|r| r.destroy}
end
protected