mirror of
https://github.com/fspc/BikeShed-1.git
synced 2026-09-16 08:31:36 -04:00
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:
@@ -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
|
||||
|
||||
@@ -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
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user