delete_if threw errors, so convert things to arrays for it
This commit is contained in:
parent
d4f72bac65
commit
7877e5bdbc
1 changed files with 6 additions and 6 deletions
|
@ -72,9 +72,9 @@ class MapsController < ApplicationController
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html {
|
format.html {
|
||||||
@allmappers = @map.contributors
|
@allmappers = @map.contributors
|
||||||
@alltopics = @map.topics.delete_if {|t| t.permission == "private" && (!authenticated? || (authenticated? && @current.id != t.user_id)) }
|
@alltopics = @map.topics.to_a.delete_if {|t| t.permission == "private" && (!authenticated? || (authenticated? && @current.id != t.user_id)) }
|
||||||
@allsynapses = @map.synapses.delete_if {|s| s.permission == "private" && (!authenticated? || (authenticated? && @current.id != s.user_id)) }
|
@allsynapses = @map.synapses.to_a.delete_if {|s| s.permission == "private" && (!authenticated? || (authenticated? && @current.id != s.user_id)) }
|
||||||
@allmappings = @map.mappings.delete_if {|m|
|
@allmappings = @map.mappings.to_a.delete_if {|m|
|
||||||
if m.category == "Synapse"
|
if m.category == "Synapse"
|
||||||
object = m.synapse
|
object = m.synapse
|
||||||
elsif m.category == "Topic"
|
elsif m.category == "Topic"
|
||||||
|
@ -100,9 +100,9 @@ class MapsController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
@allmappers = @map.contributors
|
@allmappers = @map.contributors
|
||||||
@alltopics = @map.topics.delete_if {|t| t.permission == "private" && (!authenticated? || (authenticated? && @current.id != t.user_id)) }
|
@alltopics = @map.topics.to_a.delete_if {|t| t.permission == "private" && (!authenticated? || (authenticated? && @current.id != t.user_id)) }
|
||||||
@allsynapses = @map.synapses.delete_if {|s| s.permission == "private" && (!authenticated? || (authenticated? && @current.id != s.user_id)) }
|
@allsynapses = @map.synapses.to_a.delete_if {|s| s.permission == "private" && (!authenticated? || (authenticated? && @current.id != s.user_id)) }
|
||||||
@allmappings = @map.mappings.delete_if {|m|
|
@allmappings = @map.mappings.to_a.delete_if {|m|
|
||||||
if m.category == "Synapse"
|
if m.category == "Synapse"
|
||||||
object = m.synapse
|
object = m.synapse
|
||||||
elsif m.category == "Topic"
|
elsif m.category == "Topic"
|
||||||
|
|
Loading…
Add table
Reference in a new issue