Guest User

Untitled

a guest
Jun 21st, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. class Party < ActiveRecord::Base
  2. validates_presence_of :game_id, :account_id
  3. belongs_to :game
  4. belongs_to :account
  5. has_many :players, :dependent => :destroy
  6. has_many :sub_parties, :dependent => :destroy, :class_name => "Party"
  7. accepts_nested_attributes_for :sub_parties
  8. after_create :up_partie_cache, :update_played_date
  9. after_destroy :down_partie_cache
  10.  
  11. //parties methods here
  12.  
  13. end
Add Comment
Please, Sign In to add comment