Guest User

Untitled

a guest
Jan 21st, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1.  
  2. class User < ActiveRecord::Base
  3. has_many :customers, :class_name => "User", :foreign_key => "advocate_id"
  4. belongs_to :advocate, :class_name => "User"
  5. has_many :caredates
  6. end
  7.  
  8. class Caredate < ActiveRecord::Base
  9. belongs_to :user
  10. end
  11.  
  12. class CaredatesController < ApplicationController
  13. load_and_authorize_resource
  14. def index
  15. @caredates = Caredate.accessible_by(current_ability)
  16. end
  17. end
Add Comment
Please, Sign In to add comment