How to do rake db:seed in using neo4j gem in rails 4
Neo4j is a graph database, using neo4j gem(https://github.com/neo4jrb/neo4j) we can easily use neo4j database in our ruby on rails application (http://programminginrubyonrails.blogspot.in/2014/12/neo-4j-with-rails.html).
Till now neo4j gem does not support rake db tasks. You can check all the supported task by typing
rake -T in your console.
Now we can create our own custom rake task to seed some data in neo4j.
Step 1: Create a file under lib/tasks name it seed.rake
Step 2: Put the below code in seed.rake.
Till now neo4j gem does not support rake db tasks. You can check all the supported task by typing
rake -T in your console.
Now we can create our own custom rake task to seed some data in neo4j.
Step 1: Create a file under lib/tasks name it seed.rake
Step 2: Put the below code in seed.rake.
namespace :db do
desc 'Load the seed data from db/seeds.rb'
task :seed => :environment do
seed_file = File.join(Rails.root, 'db', 'seeds.rb')
load(seed_file) if File.exist?(seed_file)
end
end
desc 'Load the seed data from db/seeds.rb'
task :seed => :environment do
seed_file = File.join(Rails.root, 'db', 'seeds.rb')
load(seed_file) if File.exist?(seed_file)
end
end
That's it. now you can run rake db:seed from your terminal.. Simple :)
Karayolu yurtdışı kargo
ReplyDeleteDenizyolu yurtdışı kargo
Havayolu yurtdışı kargo
Demiryolu yurtdışı kargo
Avusturya yurtdışı kargo
43KW
شركة تسليك مجاري في عجمان fnDCkVMRzb
ReplyDeleteشركة تنظيف سجاد بخميس مشيط RyQC4ii1Lm
ReplyDelete