Created
August 27, 2012 19:48
-
-
Save andywenk/3491715 to your computer and use it in GitHub Desktop.
active_admin_example models
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 < ActiveRecord::Base | |
has_many :orders | |
attr_accessible :first_name, :last_name | |
end | |
class Order < ActiveRecord::Base | |
belongs_to :user | |
has_many :order_items | |
attr_accessible :total, :user_id | |
end | |
class OrderItem < ActiveRecord::Base | |
belongs_to :order | |
attr_accessible :order_id, :product_id, :quantity | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment