lib/atome/genesis/particles/hierarchy.rb in atome-0.5.7.3.9 vs lib/atome/genesis/particles/hierarchy.rb in atome-0.5.7.4.2
- old
+ new
@@ -5,26 +5,19 @@
parent = grab(child.attach)
parent.fasten.delete(@id)
end
-# def detach_from_parent(parent_found, child_found)
-# child_found.attach(parent_found.id)
-# end
-
def attachment_common(child_id, parents_id, direction, &user_proc)
parent_found = grab(parents_id)
if direction == :attach
if parent_found
parent_found.fasten ||= []
parent_found.fasten.push(@id) unless parent_found.fasten.include?(@id)
detach_child(self)
render(:attach, parents_id, &user_proc)
- else
- # we remove the current id from parent
- # grab(attach).fasten.delete(@id)
end
else
child_found = grab(child_id)
child_found.attach(parents_id)
child_found.render(:attach, parents_id, &user_proc)
@@ -108,33 +101,6 @@
end
children_ids
end
-# new({ particle: :detached, category: :hierarchy, type: :string, store: false }) # unfastened
-# new({ sanitizer: :detached }) do |values|
-# # unfastened
-# if values.innew({ particle: :detached, category: :hierarchy, type: :string, store: false }) # unfastened
-# # new({ sanitizer: :detached }) do |values|
-# # # unfastened
-# # if values.instance_of? Array
-# # values.each do |value|
-# # detach_atome(value)
-# # end
-# # else
-# # detach_atome(values)
-# # # we sanitize the values so it always return an array to the renderer
-# # values = [values]
-# # end
-# # values
-# # endstance_of? Array
-# values.each do |value|
-# detach_atome(value)
-# end
-# else
-# detach_atome(values)
-# # we sanitize the values so it always return an array to the renderer
-# values = [values]
-# end
-# values
-# end
new({ particle: :collect, category: :hierarchy, type: :string })