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

Item create method passing #13

Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
4fbf10d
gemfile, .env/gitignore, and config/initializers/omniauth files created
canaanwest Oct 17, 2017
3ffb1a7
created category model, installed awesome_print, removed foundation v…
murog Oct 18, 2017
ba501a2
created product model
murog Oct 18, 2017
12d533d
created user model
murog Oct 18, 2017
ca42398
created entry model
murog Oct 18, 2017
432e192
created reveiw model
murog Oct 18, 2017
4701c5e
created order model
murog Oct 18, 2017
5ee12bc
created billing datum model
murog Oct 18, 2017
0f51c91
created controllers for each model
murog Oct 18, 2017
0753a3d
created MainPage controller
murog Oct 18, 2017
64c8630
added foreign keys to models
murog Oct 18, 2017
6370e1e
renamed entries to items, deleted entries model and controller compon…
murog Oct 18, 2017
9532d75
created item model
murog Oct 18, 2017
422c42c
created orderproduct table with foreign keys, updated order_prouct an…
murog Oct 18, 2017
6159923
created categories products join table, updated category and product …
murog Oct 18, 2017
cabe56c
added order_product, product, review and user validations
murog Oct 18, 2017
f6644c6
added validations to billing datum, category, item
murog Oct 18, 2017
5d90927
add session id to order, changed default values for items purchase an…
murog Oct 18, 2017
f8d423f
Reviews controller methods completed
Oct 18, 2017
9365d1b
updated review controller private method
Oct 18, 2017
856b9a2
Merge branch 'master' of https://github.com/canaanwest/betsy
Oct 18, 2017
07c9c89
yml files set up with appropriate categories
canaanwest Oct 18, 2017
b8e8ba4
added flash info to the application.html.erb
Oct 18, 2017
d9a6509
updated validations for category order order_product and product
murog Oct 18, 2017
e60e9b2
added reference of billing datum to user, updated belongs_to relation…
murog Oct 18, 2017
e7447de
change to redirect
Oct 18, 2017
d9befa9
Merge branch 'master' of https://github.com/canaanwest/betsy
murog Oct 18, 2017
4e9e4c7
fixed typo in product model
murog Oct 18, 2017
7331063
Merge branch 'gm-verify-validations'
murog Oct 18, 2017
e1ebeb4
reviews fixture
canaanwest Oct 18, 2017
bb0f056
fixed belong_to order relationship in item to be optional
murog Oct 18, 2017
b10dc3c
added model data as separate csv files and populated the seeds.rb file
julmeier Oct 18, 2017
df14d8f
Merge branch 'master' of https://github.com/canaanwest/betsy
julmeier Oct 18, 2017
78bfac9
yml files populated
canaanwest Oct 18, 2017
89a2bf9
routes and nested routes completed
Oct 18, 2017
d4cb7ee
Merge branch 'routes_and_resources'
Oct 18, 2017
9337b7f
removed symbols from items.yml
murog Oct 18, 2017
7d1fb56
Merge pull request #1 from canaanwest/testing-fixtures
murog Oct 18, 2017
5c11692
updated to root to for methods
Oct 18, 2017
42cd24e
Merge branch 'reviews_controller_MM'
Oct 18, 2017
aa0931a
Merge branch 'master' of https://github.com/canaanwest/betsy
Oct 18, 2017
d3f3523
moved seed data into a folder
murog Oct 18, 2017
1d8c433
moved user seeds into seed data folder
murog Oct 18, 2017
e5070b2
added billing tests for create, new, index
canaanwest Oct 18, 2017
f2010c5
moved user seeds
murog Oct 18, 2017
baf12fc
billing_data methods complteted(first walk through)
Oct 18, 2017
5b532f6
review belongs to user set as optional
murog Oct 18, 2017
68086a9
Merge branch 'billing_data_controller_methods'
Oct 18, 2017
af5715f
created users controller
Oct 18, 2017
bd1062c
created structure for reviews_controller_test. Will push and move on …
julmeier Oct 18, 2017
ad061bc
Merge branch 'master' of https://github.com/canaanwest/betsy into JM/…
julmeier Oct 18, 2017
06272c7
product model test validations for name and price
canaanwest Oct 19, 2017
4f30bf2
Manually created user views.
Oct 19, 2017
3f9e58e
Manually created user controller test file.
Oct 19, 2017
494613f
finishing up validations for products
canaanwest Oct 19, 2017
3b15057
Fixing seed data formatting
canaanwest Oct 19, 2017
8b8c7f9
updates and model tests
Oct 19, 2017
20c9e5e
Added CSV files & Fixed merge cnflt
canaanwest Oct 19, 2017
41c66d6
Merge branch 'mm/users_controller_tests_and_methods'
Oct 19, 2017
51fe814
changed category seeds
julmeier Oct 19, 2017
269581e
modifications to controller
canaanwest Oct 19, 2017
dd6f66b
user model tests passing
Oct 19, 2017
88f9217
Fixing merge conflict in CSV (currently all commented out)
canaanwest Oct 19, 2017
b3b69d1
Merge branch 'mm/users_controller_tests_and_methods'
Oct 19, 2017
9c1eb43
Merge branch 'master' of https://github.com/canaanwest/betsy
Oct 19, 2017
12b2a01
removing producT controller (singular)
canaanwest Oct 19, 2017
d984b07
Merge branch 'master' of https://github.com/canaanwest/betsy
canaanwest Oct 19, 2017
200344e
added an additional model user model test
Oct 19, 2017
c64ed30
Merge branch 'master' of https://github.com/canaanwest/betsy
Oct 19, 2017
57f7ba3
complete user controller methods and tests
Oct 19, 2017
717df4e
added and additional test to the users controller
Oct 19, 2017
51c6024
completed basic model testing
Oct 19, 2017
402c219
minor changes
Oct 19, 2017
f35e62e
completed item model tests
Oct 19, 2017
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
added reference of billing datum to user, updated belongs_to relation…
…ship between billing datum and user as optional in both models
  • Loading branch information
murog committed Oct 18, 2017
commit e60e9b27ba53e5e4ed2189e81d931ed61e9c55e0
3 changes: 2 additions & 1 deletion app/models/billing_datum.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
class BillingDatum < ApplicationRecord
has_many :orders
belongs_to :user, optional: true
validates :email, presence: true
validates :mailing_address, presence: true
validates :credit_card_name, presence: true
validates :credit_card_number, presence: true
validates :credit_card_cvv, presence: true
validates :billing_zip_code, presence: true

end
1 change: 1 addition & 0 deletions app/models/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ class User < ApplicationRecord
has_many :products
has_many :orders
has_many :reviews
belongs_to :billing_datum, optional: true
validates :username, presence: true
validates :username, uniqueness: true
validates :email, presence: true
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class AddReferenceToBillingDatainUser < ActiveRecord::Migration[5.1]
def change
add_reference :users, :billing_datum, foreign_key: true
end
end
5 changes: 4 additions & 1 deletion db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema.define(version: 20171018194851) do
ActiveRecord::Schema.define(version: 20171018204317) do

# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
Expand Down Expand Up @@ -103,6 +103,8 @@
t.string "email"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.bigint "billing_datum_id"
t.index ["billing_datum_id"], name: "index_users_on_billing_datum_id"
end

add_foreign_key "billing_data", "users"
Expand All @@ -116,4 +118,5 @@
add_foreign_key "products", "users"
add_foreign_key "reviews", "products"
add_foreign_key "reviews", "users"
add_foreign_key "users", "billing_data"
end