r
end
+ def copy
+ attr = self.copy_attributes
+ Sheet.each_element_class_names do |n|
+ attr.merge! Sheet.class_name_to_class(n).panelize(self.elements_by_class_name(n).map {|elm| elm.copy_attributes})
+ end
+ attr
+ end
+
+ def copy_attributes
+ r = self.attributes
+ r.delete 'id'
+ r.delete 'author_id'
+ r.delete 'created_at'
+ r.delete 'updated_at'
+ r
+ end
+
+ def self.panelize sheet
+ attr = sheet.attributes
+ attr.delete 'id'
+ attr
+ end
+
end