Fix merge bug. Take back method. Refs #1
This commit is contained in:
parent
f1465f51ca
commit
a855366a75
|
@ -72,16 +72,12 @@ class PlatformsController < ApplicationController
|
|||
def update
|
||||
@admin_id = params[:admin_id]
|
||||
@admin_uname = params[:admin_uname]
|
||||
#@platform.owner = @admin_id.blank? ? get_owner : User.find(@admin_id)
|
||||
#if @platform.save!
|
||||
|
||||
if @platform.update_attributes(
|
||||
:owner => @admin_id.blank? ? get_owner : User.find(@admin_id),
|
||||
:description => params[:platform][:description],
|
||||
:released => params[:platform][:released]
|
||||
)
|
||||
#@platform.make_admin_relation(@admin_id)
|
||||
>>>>>>> master
|
||||
flash[:notice] = I18n.t("flash.platform.saved")
|
||||
redirect_to @platform
|
||||
else
|
||||
|
|
|
@ -129,6 +129,13 @@ class Platform < ActiveRecord::Base
|
|||
system("sudo rm -Rf #{mount_path}")
|
||||
end
|
||||
|
||||
def update_owner_relation
|
||||
if owner_id_was != owner_id
|
||||
r = relations.where(:object_id => owner_id_was, :object_type => owner_type_was)[0]
|
||||
r.update_attributes(:object_id => owner_id, :object_type => owner_type)
|
||||
end
|
||||
end
|
||||
|
||||
protected
|
||||
|
||||
def build_path(dir)
|
||||
|
|
Loading…
Reference in New Issue