Sha256: e23f47d43a5768bdc40053061e264f5c9050101c1d6b987d4263d2ea2168201e

Contents?: true

Size: 499 Bytes

Versions: 5

Compression:

Stored size: 499 Bytes

Contents

class <%= class_name %>
  include ApacheAge::Entities::Node

<%- attributes_list.each do |attribute| -%>
  attribute :<%= attribute[:name] %>, :<%= attribute[:type] %>
<%- end -%>

<%- attributes_list.each do |attribute| -%>
  validates :<%= attribute[:name] %>, presence: true
<%- end -%>

  # custom unique node validator (remove any attributes that are NOT important to uniqueness)
  validates_with(
    ApacheAge::Validators::UniqueNode,
    attributes: <%= unique_attributes.inspect %>
  )
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
rails_age-0.6.4 lib/generators/apache_age/node/templates/node.rb.tt
rails_age-0.6.3 lib/generators/apache_age/node/templates/node.rb.tt
rails_age-0.6.2 lib/generators/apache_age/node/templates/node.rb.tt
rails_age-0.6.1 lib/generators/apache_age/node/templates/node.rb.tt
rails_age-0.6.0 lib/generators/apache_age/node/templates/node.rb.tt