<%= indented_namespace %> <%= ' ' * class_path.length %>class <%= class_name %> <%= ' ' * class_path.length %> include ApacheAge::Entities::Edge <%- attributes_list.each do |attribute| -%> <%= ' ' * class_path.length %> attribute :<%= attribute[:name] %>, :<%= attribute[:reference] || attribute[:type] %> <%- end -%> <%= ' ' * class_path.length %> validates :<%= unique_attributes.first %>, presence: true <%= ' ' * class_path.length %> validate :validate_unique <%= ' ' * class_path.length %> private <%= ' ' * class_path.length %> def validate_unique <%= ' ' * class_path.length %> ApacheAge::Validators::UniqueEdgeValidator <%= ' ' * class_path.length %> .new(attributes: <%= unique_attributes.inspect %>) <%= ' ' * class_path.length %> .validate(self) <%= ' ' * class_path.length %> end <%= ' ' * class_path.length %>end <%= indented_end_namespace %>