#692: small refactoring according to Alexander's comments
This commit is contained in:
parent
c36ae5413b
commit
e5af275c3a
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue