Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 1.2.3.) Account model [belongs_to :customer, has_many :offers, through: services]
- - customer_id [references/int]
- - saldo [decimal - 9,2]
- - status [string] [active / blocked]
- - block_reason [string]
- - db_name
- - db_user
- - db_password
- 1.2.4.) Service model [belongs_to :offer]
- - service_name [string] [sale / crm / schedule]
- - offer_id [references/int]
- 1.2.5.) Offer model [has_many :services]
- - name [string]
- - service_name [string] [sale / crm / schedule]
- - limits [hstore]
- Example scenario:
- - table offers
- id: 1, name: "Winter offer for crm", service_name: "crm", limits: {contacts_limit: 5}
- id: 2, name: "Winter offer for sale", service_name: "sales", limits: {sales_limit: 100}
- - table services:
- id: 1, service_name: "crm", offer_id: 1
- id: 2, service_name: "sales", offer_id: 2
- - table account_services:
- id: 1, account_id: 1, service_id: 1
- id: 2, account_id: 1, service_id: 2
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement