Skip to content

Commit

Permalink
New syntax for model generators and timestamps
Browse files Browse the repository at this point in the history
  • Loading branch information
Arlston Fernandes committed May 2, 2014
1 parent a76556d commit c43f29c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions lib/rails/generators/neo4j/model/model_generator.rb
Expand Up @@ -70,11 +70,11 @@ def parent?

def timestamp_statements
%q{
property :created_at, :type => DateTime
# property :created_on, :type => Date
property :created_at, type: DateTime
# property :created_on, type: Date
property :updated_at, :type => DateTime
# property :updated_on, :type => Date
property :updated_at, type: DateTime
# property :updated_on, type: Date
}
end

Expand Down
2 changes: 1 addition & 1 deletion lib/rails/generators/neo4j/model/templates/model.erb
@@ -1,7 +1,7 @@
class <%= class_name %> <%= parent? ? "#{options[:parent].classify}" : "" %>
include Neo4j::ActiveNode
<% attributes.each do |attribute| -%>
property :<%= attribute.name %><%= ", :type => #{attribute.type_class}" unless attribute.type_class == 'any' %>
property :<%= attribute.name %><%= ", type: #{attribute.type_class}" unless attribute.type_class == 'any' %>
<%= index_fragment(attribute.name) %>
<% end -%>
<%= has_n_statements if has_n? -%>
Expand Down

0 comments on commit c43f29c

Please sign in to comment.