Adding transactions

-Need to create a customers table to store contact information of customers who are not a user.
-Need to scope "User Transactions" for users, staff, and admin. Need to have a "All Shop Transactions" tab.
-Need to add conditional UX to form.
This commit is contained in:
Jason Denney
2013-01-19 15:59:47 -05:00
parent a9533e6249
commit 11e738b428
7 changed files with 42 additions and 5 deletions
+2
View File
@@ -2,6 +2,8 @@ class Bike < ActiveRecord::Base
acts_as_loggable
attr_accessible :serial_number, :bike_brand_id, :bike_model_id, :color, :bike_style_id, :seat_tube_height,
:top_tube_length, :wheel_size, :value, :bike_condition_id, :bike_status_id
has_many :transactions
has_one :owner, :class_name => 'User'
belongs_to :bike_brand
+8
View File
@@ -0,0 +1,8 @@
class Transaction < ActiveRecord::Base
acts_as_loggable
attr_accessible :vendor_id, :customer_id, :customer_type, :bike_id, :amount, :item
belongs_to :vendor, :class_name => 'User', :foreign_key => 'vendor_id'
belongs_to :bike
end
+1
View File
@@ -10,6 +10,7 @@ class User < ActiveRecord::Base
:first_name, :last_name, :nickname, :user_role_id, :bike_id,
:user_profiles_attributes
has_many :transactions
has_many :user_profiles
accepts_nested_attributes_for :user_profiles, allow_destroy: false