lib/rails/generators/neo4j/model/model_generator.rb in neo4j-3.0.0.alpha.11 vs lib/rails/generators/neo4j/model/model_generator.rb in neo4j-3.0.0.rc.2
- old
+ new
@@ -7,11 +7,11 @@
class_option :timestamps, :type => :boolean
class_option :parent, :type => :string, :desc => "The parent class for the generated model"
class_option :indices, :type => :array, :desc => "The properties which should be indexed"
class_option :has_one, :type => :array, :desc => "A list of has_one relationships"
- class_option :has_n, :type => :array, :desc => "A list of has_n relationships"
+ class_option :has_many, :type => :array, :desc => "A list of has_many relationships"
def create_model_file
template "model.erb", File.join('app/models', "#{singular_name}.rb")
end
@@ -22,18 +22,18 @@
def timestamps?
options[:timestamps]
end
- def has_n?
- options[:has_n]
+ def has_many?
+ options[:has_many]
end
- def has_n_statements
+ def has_many_statements
txt = ""
- options[:has_n].each do |key|
- txt << has_x('has_n', key)
+ options[:has_many].each do |key|
+ txt << has_x('has_many', key)
end
txt
end
def has_one?
@@ -77,6 +77,6 @@
# property :updated_on, type: Date
}
end
hook_for :test_framework
-end
\ No newline at end of file
+end