fix map forking (fix #540)
This commit is contained in:
parent
7bb7f345f1
commit
837e4bde1b
1 changed files with 25 additions and 26 deletions
|
@ -162,13 +162,13 @@ class MapsController < ApplicationController
|
||||||
@all = @all.split(',')
|
@all = @all.split(',')
|
||||||
@all.each do |topic|
|
@all.each do |topic|
|
||||||
topic = topic.split('/')
|
topic = topic.split('/')
|
||||||
mapping = Mapping.new()
|
mapping = Mapping.new
|
||||||
|
mapping.map = @map
|
||||||
mapping.user = @user
|
mapping.user = @user
|
||||||
mapping.mappable = Topic.find(topic[0])
|
mapping.mappable = Topic.find(topic[0])
|
||||||
mapping.xloc = topic[1]
|
mapping.xloc = topic[1]
|
||||||
mapping.yloc = topic[2]
|
mapping.yloc = topic[2]
|
||||||
@map.topicmappings << mapping
|
authorize mapping, :create?
|
||||||
authorize mapping, :create
|
|
||||||
mapping.save
|
mapping.save
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -176,12 +176,11 @@ class MapsController < ApplicationController
|
||||||
@synAll = params[:synapsesToMap]
|
@synAll = params[:synapsesToMap]
|
||||||
@synAll = @synAll.split(',')
|
@synAll = @synAll.split(',')
|
||||||
@synAll.each do |synapse_id|
|
@synAll.each do |synapse_id|
|
||||||
mapping = Mapping.new()
|
mapping = Mapping.new
|
||||||
mapping.user = @user
|
|
||||||
mapping.map = @map
|
mapping.map = @map
|
||||||
|
mapping.user = @user
|
||||||
mapping.mappable = Synapse.find(synapse_id)
|
mapping.mappable = Synapse.find(synapse_id)
|
||||||
@map.synapsemappings << mapping
|
authorize mapping, :create?
|
||||||
authorize mapping, :create
|
|
||||||
mapping.save
|
mapping.save
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue