Sha256: 773de3c80c6add50b634bb00ec1af6361cc2a36951d1c5d93215fcc9e81e2513

Contents?: true

Size: 845 Bytes

Versions: 22

Compression:

Stored size: 845 Bytes

Contents

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

class Neo4j::Generators::ModelGenerator < Neo4j::Generators::Base #:nodoc:
	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

22 entries across 22 versions & 1 rubygems

Version Path
neo4j-1.2.4-java lib/generators/neo4j/model/model_generator.rb
neo4j-1.2.3-java lib/generators/neo4j/model/model_generator.rb
neo4j-1.2.2-java lib/generators/neo4j/model/model_generator.rb
neo4j-1.2.1-java lib/generators/neo4j/model/model_generator.rb
neo4j-1.2.0-java lib/generators/neo4j/model/model_generator.rb
neo4j-1.1.4-java lib/generators/neo4j/model/model_generator.rb
neo4j-1.1.3-java lib/generators/neo4j/model/model_generator.rb
neo4j-1.1.2-java lib/generators/neo4j/model/model_generator.rb
neo4j-1.1.1-java lib/generators/neo4j/model/model_generator.rb
neo4j-1.1.0-java lib/generators/neo4j/model/model_generator.rb
neo4j-1.1.0.beta.3-java lib/generators/neo4j/model/model_generator.rb
neo4j-1.1.0.beta.2-java lib/generators/neo4j/model/model_generator.rb
neo4j-1.1.0.beta.1-java lib/generators/neo4j/model/model_generator.rb
neo4j-1.0.0-java lib/generators/neo4j/model/model_generator.rb
neo4j-1.0.0.beta.32-java lib/generators/neo4j/model/model_generator.rb
neo4j-1.0.0.beta.31-java lib/generators/neo4j/model/model_generator.rb
neo4j-1.0.0.beta.30-java lib/generators/neo4j/model/model_generator.rb
neo4j-1.0.0.beta.29-java lib/generators/neo4j/model/model_generator.rb
neo4j-1.0.0.beta.28-java lib/generators/neo4j/model/model_generator.rb
neo4j-1.0.0.beta.27-java lib/generators/neo4j/model/model_generator.rb