Sha256: b8af22688fb2ef6e7d86ba37769491ef5c858502355bdde68f3bdebda78ddfb2

Contents?: true

Size: 836 Bytes

Versions: 5

Compression:

Stored size: 836 Bytes

Contents

require File.join(File.dirname(__FILE__), '..', '..', 'neo4j.rb')

class Neo4j::Generators::ModelGenerator < Neo4j::Generators::Base
	argument :attributes, :type => :array, :default => [], :banner => "field:type field:type"
	
	check_class_collision
	
	class_option :timestamps, :type => :boolean
	class_option :parent,     :type => :string, :desc => "The parent class for the generated model"
	
	def create_model_file
		template "model.erb", File.join('app/models', "#{singular_name}.rb")
	end
	
	protected
	def migration?
		false
	end
	
	def timestamps?
		options[:timestamps]
	end
	
	def parent?
		options[:parent]
	end
	
	def timestamp_statements
		%q{
  property :created_at, DateTime
  # property :created_on, Date

  property :updated_at, DateTime
  # property :updated_on, Date
}            
	end
	
	hook_for :test_framework
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
neo4j-1.0.0.beta.24-java lib/generators/neo4j/model/model_generator.rb
neo4j-1.0.0.beta.23-java lib/generators/neo4j/model/model_generator.rb
neo4j-1.0.0.beta.22-java lib/generators/neo4j/model/model_generator.rb
neo4j-1.0.0.beta.21-java lib/generators/neo4j/model/model_generator.rb
neo4j-1.0.0.beta.20 lib/generators/neo4j/model/model_generator.rb