Skip to content

Instantly share code, notes, and snippets.

@andywenk
Created August 27, 2012 19:48
Show Gist options
  • Save andywenk/3491715 to your computer and use it in GitHub Desktop.
Save andywenk/3491715 to your computer and use it in GitHub Desktop.
active_admin_example models
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