{"action":"created","comment":{"url":"https://api.github.com/repos/martensonbj/little_shop/pulls/comments/49544343","id":49544343,"diff_hunk":"@@ -1,7 +1,114 @@\n-# This file should contain all the record creation needed to seed the database with its default values.\n-# The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).\n-#\n-# Examples:\n-#\n-#   cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }])\n-#   Mayor.create(name: 'Emanuel', city: cities.first)\n+class Seed\n+  def self.start\n+    new.generate\n+  end\n+\n+  def generate\n+    create_categories\n+    create_artists\n+    create_items\n+  end\n+\n+  def create_categories\n+    categories = %w(Painting Digital Photography)\n+\n+    categories.each do |name|\n+      Category.create!(name: name)\n+      puts \"Created Category: #{name}\"\n+    end\n+\n+    @painting = Category.find_by(name: categories[0])\n+    @digital = Category.find_by(name: categories[1])\n+    @photography = Category.find_by(name: categories[2])\n+  end\n+\n+  def create_artists\n+    artists = [\"Brenna Martenson\",\n+               \"Taylor Moore\",\n+               \"Toni Rib\"]\n+\n+    artists.each do |full_name|\n+      first_name = full_name.split.first\n+      last_name = full_name.split.last\n+\n+      Artist.create!(first_name: first_name, last_name: last_name)\n+      puts \"Created Artist: #{full_name}\"\n+    end\n+\n+    @brenna = Artist.find_by(first_name: \"Brenna\")\n+    @taylor = Artist.find_by(first_name: \"Taylor\")\n+    @toni = Artist.find_by(first_name: \"Toni\")\n+  end\n+\n+  def create_items\n+    Item.create!(title: \"Paris\",\n+                 description: \"Oil painting of Paris and the Eiffel Tower\",\n+                 price: 200,\n+                 image_path: \"http://paintingandframe.com/uploadpic/brent_heighton/big/april_in_paris.jpg\",\n+                 artist_id: @brenna.id,\n+                 category_id: @painting.id)\n+    Item.create!(title: \"German Castle\",\n+                 description: \"Photograph of an awe inspiring German castle\",\n+                 price: 100,\n+                 image_path: \"http://hotpenguin.net/wp-content/uploads/2013/10/Neuschwanstein-Germany-photography-by-wohli-45-Awe-Inspiring-Landmarks-Around-The-World.jpeg\",\n+                 artist_id: @brenna.id,\n+                 category_id: @photography.id)\n+    Item.create!(title: \"Shanghai Landscape\",\n+                 description: \"Photograph of the TV Tower in Shanghai\",\n+                 price: 80,\n+                 image_path: \"http://d1xejl9xcsndu9.cloudfront.net/wp-content/uploads/2013/09/Shanghai-think-636x431.jpg\",\n+                 artist_id: @brenna.id,\n+                 category_id: @photography.id)\n+    Item.create!(title: \"Aurora Borealis\",\n+                 description: \"Photograph of the Aurora Borealis in winter\",\n+                 price: 150,\n+                 image_path: \"http://i.space.com/images/i/000/034/748/i02/2_Northern_Lights_Milky_Way_at_Pemaquid.jpg?1385159454\",\n+                 artist_id: @brenna.id,\n+                 category_id: @photography.id)\n+    Item.create!(title: \"Sailboat in Fall\",\n+                 description: \"Acrylic painting of a colorful sailboat\",\n+                 price: 200,\n+                 image_path: \"https://dsarasais.files.wordpress.com/2013/11/victorfigol21.jpg\",\n+                 artist_id: @toni.id,\n+                 category_id: @painting.id)\n+    Item.create!(title: \"Colorful Trees\",\n+                 description: \"Digital image of amazing colorful trees that fill you with whimsy\",\n+                 price: 60,\n+                 image_path: \"https://img0.etsystatic.com/013/0/5265257/il_fullxfull.452732472_p61u.jpg\",\n+                 artist_id: @toni.id,\n+                 category_id: @digital.id)\n+    Item.create!(title: \"Flower Girl\",\n+                 description: \"Digital art of a woman with a flowering face\",\n+                 price: 150,\n+                 image_path: \"http://ego-alterego.com/wp-content/uploads/2014/02/Anna-Dittmann-digital-art5.jpg\",\n+                 artist_id: @toni.id,\n+                 category_id: @digital.id)\n+    Item.create!(title: \"Darkness\",\n+                 description: \"Painting of the dark knight, brooding over evil\",\n+                 price: 300,\n+                 image_path: \"http://www.softpainting.com/wp-content/uploads/2015/12/Batman-Painting-8.jpg\",\n+                 artist_id: @taylor.id,\n+                 category_id: @painting.id)\n+    Item.create!(title: \"Aspens in the Fall\",\n+                 description: \"Amazing photograph of aspens in the Colorado Rockies\",\n+                 price: 100,\n+                 image_path: \"http://ridgwaycolorado.com/wp-content/uploads/2013/05/mt-sneffels-aspens.jpg\",","path":"db/seeds.rb","position":102,"original_position":102,"commit_id":"53246ffc946a3462f29c0398afe9d03191a9afbd","original_commit_id":"53246ffc946a3462f29c0398afe9d03191a9afbd","user":{"login":"houndci","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=3","gravatar_id":"","url":"https://api.github.com/users/houndci","html_url":"https://github.com/houndci","followers_url":"https://api.github.com/users/houndci/followers","following_url":"https://api.github.com/users/houndci/following{/other_user}","gists_url":"https://api.github.com/users/houndci/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci/subscriptions","organizations_url":"https://api.github.com/users/houndci/orgs","repos_url":"https://api.github.com/users/houndci/repos","events_url":"https://api.github.com/users/houndci/events{/privacy}","received_events_url":"https://api.github.com/users/houndci/received_events","type":"User","site_admin":false},"body":"Line is too long. [108/80]","created_at":"2016-01-13T02:14:56Z","updated_at":"2016-01-13T02:14:56Z","html_url":"https://github.com/martensonbj/little_shop/pull/29#discussion_r49544343","pull_request_url":"https://api.github.com/repos/martensonbj/little_shop/pulls/29","_links":{"self":{"href":"https://api.github.com/repos/martensonbj/little_shop/pulls/comments/49544343"},"html":{"href":"https://github.com/martensonbj/little_shop/pull/29#discussion_r49544343"},"pull_request":{"href":"https://api.github.com/repos/martensonbj/little_shop/pulls/29"}}},"pull_request":{"url":"https://api.github.com/repos/martensonbj/little_shop/pulls/29","id":55846358,"html_url":"https://github.com/martensonbj/little_shop/pull/29","diff_url":"https://github.com/martensonbj/little_shop/pull/29.diff","patch_url":"https://github.com/martensonbj/little_shop/pull/29.patch","issue_url":"https://api.github.com/repos/martensonbj/little_shop/issues/29","number":29,"state":"open","locked":false,"title":"19 seeds file","user":{"login":"ToniRib","id":10429574,"avatar_url":"https://avatars.githubusercontent.com/u/10429574?v=3","gravatar_id":"","url":"https://api.github.com/users/ToniRib","html_url":"https://github.com/ToniRib","followers_url":"https://api.github.com/users/ToniRib/followers","following_url":"https://api.github.com/users/ToniRib/following{/other_user}","gists_url":"https://api.github.com/users/ToniRib/gists{/gist_id}","starred_url":"https://api.github.com/users/ToniRib/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ToniRib/subscriptions","organizations_url":"https://api.github.com/users/ToniRib/orgs","repos_url":"https://api.github.com/users/ToniRib/repos","events_url":"https://api.github.com/users/ToniRib/events{/privacy}","received_events_url":"https://api.github.com/users/ToniRib/received_events","type":"User","site_admin":false},"body":"This branch removes the now unnecessary 'data.txt' file which I was using to manually seed the database. Instead, I used the rails `seeds.rb` file to create a new Seed class. This seed class sets up the same 3 categories, 3 artists, and 11 items in the database that I have been using.\r\n\r\nYou can now run the command `rake db:seed` to load in all of the items from the seeds file.\r\nAdditionally, you could run: `rake db:drop db:create db:migrate db:seed` as one command from your terminal to drop the current database, create, migrate, and populate with all of the seed data.\r\n\r\nOnce we merge this into master, this should allow us to run `heroku run rake db:seed` to actually populate our heroku database!","created_at":"2016-01-13T02:14:50Z","updated_at":"2016-01-13T02:14:56Z","closed_at":null,"merged_at":null,"merge_commit_sha":"aa78197d5e8a6274e5b3b441bf7257841129199b","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/martensonbj/little_shop/pulls/29/commits","review_comments_url":"https://api.github.com/repos/martensonbj/little_shop/pulls/29/comments","review_comment_url":"https://api.github.com/repos/martensonbj/little_shop/pulls/comments{/number}","comments_url":"https://api.github.com/repos/martensonbj/little_shop/issues/29/comments","statuses_url":"https://api.github.com/repos/martensonbj/little_shop/statuses/53246ffc946a3462f29c0398afe9d03191a9afbd","head":{"label":"martensonbj:19_seeds-file","ref":"19_seeds-file","sha":"53246ffc946a3462f29c0398afe9d03191a9afbd","user":{"login":"martensonbj","id":13123158,"avatar_url":"https://avatars.githubusercontent.com/u/13123158?v=3","gravatar_id":"","url":"https://api.github.com/users/martensonbj","html_url":"https://github.com/martensonbj","followers_url":"https://api.github.com/users/martensonbj/followers","following_url":"https://api.github.com/users/martensonbj/following{/other_user}","gists_url":"https://api.github.com/users/martensonbj/gists{/gist_id}","starred_url":"https://api.github.com/users/martensonbj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/martensonbj/subscriptions","organizations_url":"https://api.github.com/users/martensonbj/orgs","repos_url":"https://api.github.com/users/martensonbj/repos","events_url":"https://api.github.com/users/martensonbj/events{/privacy}","received_events_url":"https://api.github.com/users/martensonbj/received_events","type":"User","site_admin":false},"repo":{"id":49446077,"name":"little_shop","full_name":"martensonbj/little_shop","owner":{"login":"martensonbj","id":13123158,"avatar_url":"https://avatars.githubusercontent.com/u/13123158?v=3","gravatar_id":"","url":"https://api.github.com/users/martensonbj","html_url":"https://github.com/martensonbj","followers_url":"https://api.github.com/users/martensonbj/followers","following_url":"https://api.github.com/users/martensonbj/following{/other_user}","gists_url":"https://api.github.com/users/martensonbj/gists{/gist_id}","starred_url":"https://api.github.com/users/martensonbj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/martensonbj/subscriptions","organizations_url":"https://api.github.com/users/martensonbj/orgs","repos_url":"https://api.github.com/users/martensonbj/repos","events_url":"https://api.github.com/users/martensonbj/events{/privacy}","received_events_url":"https://api.github.com/users/martensonbj/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/martensonbj/little_shop","description":null,"fork":false,"url":"https://api.github.com/repos/martensonbj/little_shop","forks_url":"https://api.github.com/repos/martensonbj/little_shop/forks","keys_url":"https://api.github.com/repos/martensonbj/little_shop/keys{/key_id}","collaborators_url":"https://api.github.com/repos/martensonbj/little_shop/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/martensonbj/little_shop/teams","hooks_url":"https://api.github.com/repos/martensonbj/little_shop/hooks","issue_events_url":"https://api.github.com/repos/martensonbj/little_shop/issues/events{/number}","events_url":"https://api.github.com/repos/martensonbj/little_shop/events","assignees_url":"https://api.github.com/repos/martensonbj/little_shop/assignees{/user}","branches_url":"https://api.github.com/repos/martensonbj/little_shop/branches{/branch}","tags_url":"https://api.github.com/repos/martensonbj/little_shop/tags","blobs_url":"https://api.github.com/repos/martensonbj/little_shop/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/martensonbj/little_shop/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/martensonbj/little_shop/git/refs{/sha}","trees_url":"https://api.github.com/repos/martensonbj/little_shop/git/trees{/sha}","statuses_url":"https://api.github.com/repos/martensonbj/little_shop/statuses/{sha}","languages_url":"https://api.github.com/repos/martensonbj/little_shop/languages","stargazers_url":"https://api.github.com/repos/martensonbj/little_shop/stargazers","contributors_url":"https://api.github.com/repos/martensonbj/little_shop/contributors","subscribers_url":"https://api.github.com/repos/martensonbj/little_shop/subscribers","subscription_url":"https://api.github.com/repos/martensonbj/little_shop/subscription","commits_url":"https://api.github.com/repos/martensonbj/little_shop/commits{/sha}","git_commits_url":"https://api.github.com/repos/martensonbj/little_shop/git/commits{/sha}","comments_url":"https://api.github.com/repos/martensonbj/little_shop/comments{/number}","issue_comment_url":"https://api.github.com/repos/martensonbj/little_shop/issues/comments{/number}","contents_url":"https://api.github.com/repos/martensonbj/little_shop/contents/{+path}","compare_url":"https://api.github.com/repos/martensonbj/little_shop/compare/{base}...{head}","merges_url":"https://api.github.com/repos/martensonbj/little_shop/merges","archive_url":"https://api.github.com/repos/martensonbj/little_shop/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/martensonbj/little_shop/downloads","issues_url":"https://api.github.com/repos/martensonbj/little_shop/issues{/number}","pulls_url":"https://api.github.com/repos/martensonbj/little_shop/pulls{/number}","milestones_url":"https://api.github.com/repos/martensonbj/little_shop/milestones{/number}","notifications_url":"https://api.github.com/repos/martensonbj/little_shop/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/martensonbj/little_shop/labels{/name}","releases_url":"https://api.github.com/repos/martensonbj/little_shop/releases{/id}","created_at":"2016-01-11T18:37:54Z","updated_at":"2016-01-11T18:40:37Z","pushed_at":"2016-01-13T02:14:51Z","git_url":"git://github.com/martensonbj/little_shop.git","ssh_url":"git@github.com:martensonbj/little_shop.git","clone_url":"https://github.com/martensonbj/little_shop.git","svn_url":"https://github.com/martensonbj/little_shop","homepage":null,"size":2700,"stargazers_count":2,"watchers_count":2,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":17,"forks":0,"open_issues":17,"watchers":2,"default_branch":"master"}},"base":{"label":"martensonbj:master","ref":"master","sha":"cd7677700b1a3d27aea7e26712d11b6fce311069","user":{"login":"martensonbj","id":13123158,"avatar_url":"https://avatars.githubusercontent.com/u/13123158?v=3","gravatar_id":"","url":"https://api.github.com/users/martensonbj","html_url":"https://github.com/martensonbj","followers_url":"https://api.github.com/users/martensonbj/followers","following_url":"https://api.github.com/users/martensonbj/following{/other_user}","gists_url":"https://api.github.com/users/martensonbj/gists{/gist_id}","starred_url":"https://api.github.com/users/martensonbj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/martensonbj/subscriptions","organizations_url":"https://api.github.com/users/martensonbj/orgs","repos_url":"https://api.github.com/users/martensonbj/repos","events_url":"https://api.github.com/users/martensonbj/events{/privacy}","received_events_url":"https://api.github.com/users/martensonbj/received_events","type":"User","site_admin":false},"repo":{"id":49446077,"name":"little_shop","full_name":"martensonbj/little_shop","owner":{"login":"martensonbj","id":13123158,"avatar_url":"https://avatars.githubusercontent.com/u/13123158?v=3","gravatar_id":"","url":"https://api.github.com/users/martensonbj","html_url":"https://github.com/martensonbj","followers_url":"https://api.github.com/users/martensonbj/followers","following_url":"https://api.github.com/users/martensonbj/following{/other_user}","gists_url":"https://api.github.com/users/martensonbj/gists{/gist_id}","starred_url":"https://api.github.com/users/martensonbj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/martensonbj/subscriptions","organizations_url":"https://api.github.com/users/martensonbj/orgs","repos_url":"https://api.github.com/users/martensonbj/repos","events_url":"https://api.github.com/users/martensonbj/events{/privacy}","received_events_url":"https://api.github.com/users/martensonbj/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/martensonbj/little_shop","description":null,"fork":false,"url":"https://api.github.com/repos/martensonbj/little_shop","forks_url":"https://api.github.com/repos/martensonbj/little_shop/forks","keys_url":"https://api.github.com/repos/martensonbj/little_shop/keys{/key_id}","collaborators_url":"https://api.github.com/repos/martensonbj/little_shop/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/martensonbj/little_shop/teams","hooks_url":"https://api.github.com/repos/martensonbj/little_shop/hooks","issue_events_url":"https://api.github.com/repos/martensonbj/little_shop/issues/events{/number}","events_url":"https://api.github.com/repos/martensonbj/little_shop/events","assignees_url":"https://api.github.com/repos/martensonbj/little_shop/assignees{/user}","branches_url":"https://api.github.com/repos/martensonbj/little_shop/branches{/branch}","tags_url":"https://api.github.com/repos/martensonbj/little_shop/tags","blobs_url":"https://api.github.com/repos/martensonbj/little_shop/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/martensonbj/little_shop/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/martensonbj/little_shop/git/refs{/sha}","trees_url":"https://api.github.com/repos/martensonbj/little_shop/git/trees{/sha}","statuses_url":"https://api.github.com/repos/martensonbj/little_shop/statuses/{sha}","languages_url":"https://api.github.com/repos/martensonbj/little_shop/languages","stargazers_url":"https://api.github.com/repos/martensonbj/little_shop/stargazers","contributors_url":"https://api.github.com/repos/martensonbj/little_shop/contributors","subscribers_url":"https://api.github.com/repos/martensonbj/little_shop/subscribers","subscription_url":"https://api.github.com/repos/martensonbj/little_shop/subscription","commits_url":"https://api.github.com/repos/martensonbj/little_shop/commits{/sha}","git_commits_url":"https://api.github.com/repos/martensonbj/little_shop/git/commits{/sha}","comments_url":"https://api.github.com/repos/martensonbj/little_shop/comments{/number}","issue_comment_url":"https://api.github.com/repos/martensonbj/little_shop/issues/comments{/number}","contents_url":"https://api.github.com/repos/martensonbj/little_shop/contents/{+path}","compare_url":"https://api.github.com/repos/martensonbj/little_shop/compare/{base}...{head}","merges_url":"https://api.github.com/repos/martensonbj/little_shop/merges","archive_url":"https://api.github.com/repos/martensonbj/little_shop/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/martensonbj/little_shop/downloads","issues_url":"https://api.github.com/repos/martensonbj/little_shop/issues{/number}","pulls_url":"https://api.github.com/repos/martensonbj/little_shop/pulls{/number}","milestones_url":"https://api.github.com/repos/martensonbj/little_shop/milestones{/number}","notifications_url":"https://api.github.com/repos/martensonbj/little_shop/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/martensonbj/little_shop/labels{/name}","releases_url":"https://api.github.com/repos/martensonbj/little_shop/releases{/id}","created_at":"2016-01-11T18:37:54Z","updated_at":"2016-01-11T18:40:37Z","pushed_at":"2016-01-13T02:14:51Z","git_url":"git://github.com/martensonbj/little_shop.git","ssh_url":"git@github.com:martensonbj/little_shop.git","clone_url":"https://github.com/martensonbj/little_shop.git","svn_url":"https://github.com/martensonbj/little_shop","homepage":null,"size":2700,"stargazers_count":2,"watchers_count":2,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":17,"forks":0,"open_issues":17,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/martensonbj/little_shop/pulls/29"},"html":{"href":"https://github.com/martensonbj/little_shop/pull/29"},"issue":{"href":"https://api.github.com/repos/martensonbj/little_shop/issues/29"},"comments":{"href":"https://api.github.com/repos/martensonbj/little_shop/issues/29/comments"},"review_comments":{"href":"https://api.github.com/repos/martensonbj/little_shop/pulls/29/comments"},"review_comment":{"href":"https://api.github.com/repos/martensonbj/little_shop/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/martensonbj/little_shop/pulls/29/commits"},"statuses":{"href":"https://api.github.com/repos/martensonbj/little_shop/statuses/53246ffc946a3462f29c0398afe9d03191a9afbd"}}}}