Skip to content

Commit

Permalink
Merge 0086b7e into 82e3184
Browse files Browse the repository at this point in the history
  • Loading branch information
diegoviola committed Feb 14, 2020
2 parents 82e3184 + 0086b7e commit 5f2787d
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion app/controllers/collection_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ def owners

def add_owner
@user.owner = true
@user.account_type = "Staff"
@user.save!
@collection.owners << @user
@user.notification.owner_stats = true
Expand Down Expand Up @@ -221,7 +222,15 @@ def create
@collection = Collection.new
@collection.title = params[:collection][:title]
@collection.intro_block = params[:collection][:intro_block]
@collection.owner = current_user
if current_user.account_type != "Staff"
@collection.owner = current_user
else
current_user.collections.each do |c|
if c.owner.account_type != "Staff"
@collection.owner = c.owner
end
end
end
if @collection.save
flash[:notice] = 'Collection has been created'
if request.referrer.include?('sc_collections')
Expand Down

0 comments on commit 5f2787d

Please sign in to comment.