Do not create layout part if it already exists
This commit is contained in:
parent
4f9aa63045
commit
fbe2b26e9f
|
@ -5,7 +5,7 @@ module ParserLayout
|
|||
body = Nokogiri::HTML(layout.body)
|
||||
|
||||
body.css('.page_content').each do |content|
|
||||
layout.layout_parts.build(:name => content['name'])
|
||||
layout.layout_parts.build(:name => content['name']) unless layout.layout_parts.detect{|layout_part| layout_part.name.eql?(content['name'])}
|
||||
end
|
||||
|
||||
body.css('.page_menu').each do |menu|
|
||||
|
|
Loading…
Reference in New Issue