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

Alma Maizels & Noelle Morris #51

Open
wants to merge 55 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
72ace3e
Baseline rails app
johnanmorris Oct 4, 2016
20a4fa5
generated models Market, Vendor, Product, Sale and created relationships
johnanmorris Oct 4, 2016
4190570
added index:true
johnanmorris Oct 4, 2016
55d81ee
added initial routes
johnanmorris Oct 4, 2016
c9b6dda
added root route
johnanmorris Oct 4, 2016
a19f2e2
finished initial Market index controller and view
johnanmorris Oct 4, 2016
609ca9c
Generated controller for root and added a view page for Home with the…
mimyal Oct 4, 2016
51b7c0e
Merge branch 'b/amnm/am' into b/amnm/master
mimyal Oct 5, 2016
ca37d9a
Markets seeded into database from CSV file
mimyal Oct 5, 2016
9ce5c84
Vendors, Products and Sales seeded into database from csv-files
mimyal Oct 5, 2016
6050342
Implemented new and create controller actions; implemented new view
johnanmorris Oct 5, 2016
5f2fddf
Added error handling erb to New view
johnanmorris Oct 5, 2016
bc31204
added controller action and view for show
johnanmorris Oct 5, 2016
e955e96
Vendor controller created and show page in place. Working on making t…
mimyal Oct 5, 2016
3a3bc5b
edited routes, modified index, edit, and show views
johnanmorris Oct 5, 2016
907a5c9
Merge branch 'b/amnm/a2' into b/amnm/master
mimyal Oct 5, 2016
2457636
added link to create new market on index view
johnanmorris Oct 5, 2016
7641689
deleted validations -- these affect the seeding
johnanmorris Oct 6, 2016
ab7611c
added commented out validations for future consideration.
johnanmorris Oct 6, 2016
874a5b3
Vendor can create new products. Working on 'edit'.
mimyal Oct 6, 2016
75a58ee
added new Vendor controller actions and views; modified routes to all…
johnanmorris Oct 6, 2016
1a8352d
modified vendor routes to remove unnecessary vendor routes
johnanmorris Oct 6, 2016
2a78bcf
commented out validations for reseeding; modified new form display te…
johnanmorris Oct 6, 2016
616d1a6
Vendor edit and update of products working correctly.
mimyal Oct 6, 2016
1b63583
implemented edit and update controllers and edit view
johnanmorris Oct 6, 2016
7ed0b33
Vendors can delete products complete.
mimyal Oct 6, 2016
48b80f4
Merge branch 'b/amnm/nm3' into b/amnm/master
johnanmorris Oct 6, 2016
30382b6
CSS color and styling -- currently works for Market index and show vi…
johnanmorris Oct 7, 2016
958f121
added styling for home page via .splash class
johnanmorris Oct 7, 2016
6697ed2
modified Vendor index and show HTML to utilize styling; minor edits i…
johnanmorris Oct 7, 2016
7dfbccc
Creaetd partial views for Markets, Vendors, and Products. Not yet imp…
mimyal Oct 7, 2016
0171125
re-added super tiny but super important csrf_meta_tags which I accide…
johnanmorris Oct 7, 2016
d0e5faf
minor typo
johnanmorris Oct 7, 2016
5396376
Merge branch 'b/amnm/css' into b/amnm/master
johnanmorris Oct 7, 2016
fc4c181
edited markets form partial; edited new and edit views to utilize par…
johnanmorris Oct 7, 2016
765e6cd
modified partials and updated vendor new and edit to use partials
johnanmorris Oct 7, 2016
da27ed1
fixed routing issues
johnanmorris Oct 7, 2016
bcad8cb
Added Sales controller, new Sale view and link from Vendor show view.…
mimyal Oct 7, 2016
9f5188c
partials cleanup; added link back to Market from edit vendor page
johnanmorris Oct 7, 2016
88e06be
edited form partials for Products and edited new and edit views to ut…
johnanmorris Oct 7, 2016
89a60ee
Minor changes to routes and show vendors view. Added index controller…
mimyal Oct 7, 2016
50a8c37
Used Vendor Helper to sum the total sales up for a vendor on the Vend…
mimyal Oct 7, 2016
3cca584
converted lists to tables on Market and Vendorshow pages
johnanmorris Oct 7, 2016
2dc17cd
altered config files
johnanmorris Oct 7, 2016
98d808a
WIP db/seeds
johnanmorris Oct 7, 2016
103d4bd
Adding lists, and sums of Sales for vendors using helper files
mimyal Oct 7, 2016
e28b050
resolve merge conflicts
johnanmorris Oct 7, 2016
98fd38b
resolved merging conflicts in vendor show view
mimyal Oct 7, 2016
394f7c8
Resolve merging conflict resolve
mimyal Oct 7, 2016
59a49fa
Gemfile prepared for Heroku
mimyal Oct 7, 2016
cf7a0f1
added db:seed validations and model validations
johnanmorris Oct 7, 2016
8fd8110
Merge branch 'b/amnm/final' into b/amnm/master
johnanmorris Oct 7, 2016
f2f373d
Gemfile.lock update
johnanmorris Oct 7, 2016
4acd67f
removed 1 extra }
johnanmorris Oct 7, 2016
3dfd77f
fixed issues with seeds
johnanmorris Oct 7, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
generated models Market, Vendor, Product, Sale and created relationships
johnanmorris committed Oct 4, 2016

Verified

This commit was signed with the committer’s verified signature.
CasperWA Casper Welzel Andersen
commit 20a4fa5b96a670aaf52661dce13375bdd81fd471
3 changes: 3 additions & 0 deletions app/models/market.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
class Market < ActiveRecord::Base
has_many :vendors
end
4 changes: 4 additions & 0 deletions app/models/product.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
class Product < ActiveRecord::Base
has_many :sales
belongs_to :vendor
end
4 changes: 4 additions & 0 deletions app/models/sale.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
class Sale < ActiveRecord::Base
belongs_to :vendor
belongs_to :product
end
5 changes: 5 additions & 0 deletions app/models/vendor.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class Vendor < ActiveRecord::Base
belongs_to :market
has_many :products
has_many :sales
end
14 changes: 14 additions & 0 deletions db/migrate/20161004211327_create_markets.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
class CreateMarkets < ActiveRecord::Migration
def change
create_table :markets do |t|
t.string :name
t.string :address
t.string :city
t.string :county
t.string :state
t.string :zip

t.timestamps null: false
end
end
end
11 changes: 11 additions & 0 deletions db/migrate/20161004211338_create_vendors.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
class CreateVendors < ActiveRecord::Migration
def change
create_table :vendors do |t|
t.string :name
t.integer :num_employees
t.belongs_to :market

t.timestamps null: false
end
end
end
10 changes: 10 additions & 0 deletions db/migrate/20161004211355_create_products.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
class CreateProducts < ActiveRecord::Migration
def change
create_table :products do |t|
t.string :name
t.belongs_to :vendor

t.timestamps null: false
end
end
end
12 changes: 12 additions & 0 deletions db/migrate/20161004211407_create_sales.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
class CreateSales < ActiveRecord::Migration
def change
create_table :sales do |t|
t.integer :amount
t.datetime :purchase_time
t.belongs_to :product
t.belongs_to :vendor

t.timestamps null: false
end
end
end
51 changes: 51 additions & 0 deletions db/schema.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# encoding: UTF-8
# This file is auto-generated from the current state of the database. Instead
# of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition.
#
# Note that this schema.rb definition is the authoritative source for your
# database schema. If you need to create the application database on another
# system, you should be using db:schema:load, not running all the migrations
# from scratch. The latter is a flawed and unsustainable approach (the more migrations
# you'll amass, the slower it'll run and the greater likelihood for issues).
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema.define(version: 20161004211407) do

create_table "markets", force: :cascade do |t|
t.string "name"
t.string "address"
t.string "city"
t.string "county"
t.string "state"
t.string "zip"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end

create_table "products", force: :cascade do |t|
t.string "name"
t.integer "vendor_id"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end

create_table "sales", force: :cascade do |t|
t.integer "amount"
t.datetime "purchase_time"
t.integer "product_id"
t.integer "vendor_id"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end

create_table "vendors", force: :cascade do |t|
t.string "name"
t.integer "num_employees"
t.integer "market_id"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end

end
11 changes: 11 additions & 0 deletions test/fixtures/markets.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html

# This model initially had no columns defined. If you add columns to the
# model remove the '{}' from the fixture names and add the columns immediately
# below each fixture, per the syntax in the comments below
#
one: {}
# column: value
#
two: {}
# column: value
11 changes: 11 additions & 0 deletions test/fixtures/products.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html

# This model initially had no columns defined. If you add columns to the
# model remove the '{}' from the fixture names and add the columns immediately
# below each fixture, per the syntax in the comments below
#
one: {}
# column: value
#
two: {}
# column: value
11 changes: 11 additions & 0 deletions test/fixtures/sales.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html

# This model initially had no columns defined. If you add columns to the
# model remove the '{}' from the fixture names and add the columns immediately
# below each fixture, per the syntax in the comments below
#
one: {}
# column: value
#
two: {}
# column: value
11 changes: 11 additions & 0 deletions test/fixtures/vendors.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html

# This model initially had no columns defined. If you add columns to the
# model remove the '{}' from the fixture names and add the columns immediately
# below each fixture, per the syntax in the comments below
#
one: {}
# column: value
#
two: {}
# column: value
7 changes: 7 additions & 0 deletions test/models/market_test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
require 'test_helper'

class MarketTest < ActiveSupport::TestCase
# test "the truth" do
# assert true
# end
end
7 changes: 7 additions & 0 deletions test/models/product_test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
require 'test_helper'

class ProductTest < ActiveSupport::TestCase
# test "the truth" do
# assert true
# end
end
7 changes: 7 additions & 0 deletions test/models/sale_test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
require 'test_helper'

class SaleTest < ActiveSupport::TestCase
# test "the truth" do
# assert true
# end
end
7 changes: 7 additions & 0 deletions test/models/vendor_test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
require 'test_helper'

class VendorTest < ActiveSupport::TestCase
# test "the truth" do
# assert true
# end
end