Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix seeds #160

Closed
wants to merge 1 commit into from
Closed

Fix seeds #160

wants to merge 1 commit into from

Conversation

@mgrachev
Copy link
Contributor

@mgrachev mgrachev commented Nov 5, 2015

Hello. When you run bin/setup, I get the following error:

-- add_foreign_key("line_items", "orders")
   -> 0.0045s
-- add_foreign_key("line_items", "products")
   -> 0.0028s
-- add_foreign_key("orders", "customers")
   -> 0.0028s
-- initialize_schema_migrations_table()
   -> 0.0015s
rake aborted!
Errno::ENOENT: No such file or directory @ rb_sysopen - ./db/seeds/products.yml
/Users/mgrachev/administrate/spec/example_app/db/seeds.rb:22:in `<top (required)>'
/Users/mgrachev/administrate/vendor/bundle/gems/activesupport-4.2.2/lib/active_support/dependencies.rb:268:in `load'
/Users/mgrachev/administrate/vendor/bundle/gems/activesupport-4.2.2/lib/active_support/dependencies.rb:268:in `block in load'
/Users/mgrachev/administrate/vendor/bundle/gems/activesupport-4.2.2/lib/active_support/dependencies.rb:240:in `load_dependency'
/Users/mgrachev/administrate/vendor/bundle/gems/activesupport-4.2.2/lib/active_support/dependencies.rb:268:in `load'
/Users/mgrachev/administrate/vendor/bundle/gems/railties-4.2.2/lib/rails/engine.rb:547:in `load_seed'
/Users/mgrachev/Development/Rails/work/administrate/vendor/bundle/gems/activerecord-4.2.2/lib/active_record/tasks/database_tasks.rb:250:in `load_seed'
/Users/mgrachev/administrate/vendor/bundle/gems/activerecord-4.2.2/lib/active_record/railties/databases.rake:180:in `block (2 levels) in <top (required)>'
Tasks: TOP => db:setup => db:seed
(See full trace by running task with --trace)

Minor improvements when loading seed.

@@ -19,7 +19,7 @@
)
end

product_attributes = YAML.load_file("./db/seeds/products.yml")
product_attributes = YAML.load_file(File.expand_path('../db/seeds/products.yml', __dir__))

This comment has been minimized.

@houndci-bot

houndci-bot Nov 5, 2015

Line is too long. [90/80]
Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.

@gracewashere
Copy link
Contributor

@gracewashere gracewashere commented Nov 5, 2015

Good catch, thanks! It seems that we forgot to update the seeds file when we merged #144.

@gracewashere
Copy link
Contributor

@gracewashere gracewashere commented Nov 5, 2015

Merged in f5c6058. Thanks!

@mgrachev mgrachev deleted the mgrachev:fix-setup branch Nov 6, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants