Class: Budget
- Inherits:
 - 
      ApplicationRecord
      
        
- Object
 - ActiveRecord::Base
 - ApplicationRecord
 - Budget
 
 
- Defined in:
 - app/models/budget.rb
 
Overview
A certain amount of money (in a given currency) to spend in a group of events
A budget object can represent a periodic budget (like 'money to spend in Q2 of year 2013'), specific budgets for a givent event or any other amount of money. Budgets are defined for a specific currency and needs to be explicity associated to a group of events. If an event is associated to several budgets with the same currency, the amounts are added.
Instance Attribute Summary collapse
- #amount ⇒ Decimal
 - #created_at ⇒ DateTime
 - #currency ⇒ String
 - #description ⇒ String
 - #name ⇒ String
 - #updated_at ⇒ DateTime
 
Has many collapse
- 
  
    
      #events  ⇒ ActiveRecord::Relation<Event> 
    
    
  
  
  
  
  
  
  
  
  
    
Events that are covered by the budget.
 
Methods inherited from ApplicationRecord
ransackable_associations, ransackable_attributes
Instance Attribute Details
#amount ⇒ Decimal
Validations:
      16  | 
    
      # File 'app/models/budget.rb', line 16 validates :name, :amount, :currency, presence: true  | 
  
#created_at ⇒ DateTime
      57  | 
    
      # File 'db/schema.rb', line 57 t.datetime "created_at"  | 
  
#currency ⇒ String
Validations:
      16  | 
    
      # File 'app/models/budget.rb', line 16 validates :name, :amount, :currency, presence: true  | 
  
#description ⇒ String
      54  | 
    
      # File 'db/schema.rb', line 54 t.string "description"  | 
  
#name ⇒ String
Validations:
      16  | 
    
      # File 'app/models/budget.rb', line 16 validates :name, :amount, :currency, presence: true  | 
  
#updated_at ⇒ DateTime
      58  | 
    
      # File 'db/schema.rb', line 58 t.datetime "updated_at"  | 
  
Instance Method Details
#events ⇒ ActiveRecord::Relation<Event>
Events that are covered by the budget
      14  | 
    
      # File 'app/models/budget.rb', line 14 has_many :events  |