Created
April 22, 2014 21:24
-
-
Save adeng21/11194889 to your computer and use it in GitHub Desktop.
Seed file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
category_attributes = [{name: 'Wrecks/Artifacts', image: Rails.root.join('/assets/images/categories/Wrecks.jpg')}, | |
{name: 'Caves', image: Rails.root.join('/app/assets/images/categories/Caves.jpg')}, | |
{name: 'Drift', image: Rails.root.join('/app/assets/images/categories/Drift.jpg')}, | |
{name: 'Walls', image: Rails.root.join('/app/assets/images/categories/Walls.jpg')}, | |
{name: 'Whales & Sharks', image: Rails.root.join('/app/assets/images/categories/Sharks.jpg')}, | |
{name: 'Macro/Corals', image: Rails.root.join('/app/assets/images/categories/Corals.jpg')}, | |
{name: 'Manta Rays', image:Rails.root.join('/app/assets/images/categories/Manta.jpg')}, | |
{name: 'Night', image: Rails.root.join('/app/assets/images/categories/Night.jpg')}, | |
{name: 'Turtles', image: Rails.root.join('/app/assets/images/categories/Turtles.jpg')}, | |
{name: 'Schools of Fish', image: Rails.root.join('/app/assets/images/categories/Fish.jpg')}] | |
category_attributes.each do |attributes| | |
Category.create(attributes) | |
end | |
month_attributes = [{name: 'January'}, {name: 'February'}, | |
{name: 'March'}, {name: 'April'}, {name: 'May'}, | |
{name: 'June'}, {name: 'July'}, {name: 'August'}, | |
{name: 'September'}, {name: 'October'}, {name: 'November'}, | |
{name: 'December'}] | |
month_attributes.each do |attributes| | |
Month.create(attributes) | |
end |
same with the months. use find or create by
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
you want to do