Created
August 12, 2014 15:05
-
-
Save jwo/3587b0aa24e8679e537c to your computer and use it in GitHub Desktop.
scholastic.rb
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
class User | |
has_many :orders | |
attr_accessor :name | |
attr_accessor :devise | |
end | |
class Book | |
has_many :line_items | |
has_many :orders, through: :line_items | |
attr_accessor :title | |
attr_accessor :author | |
attr_accessor :inventory | |
attr_accessor :sales_price | |
attr_accessor :msrp | |
end | |
class Order | |
belongs_to :user | |
has_many :line_items | |
has_many :books, through: :line_items | |
attr_accessor :stripe_charge_id | |
end | |
class Lineitem | |
belongs_to :order | |
belongs_to :book | |
attr_accessor :quantity | |
attr_accessor :price_paid | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment