Permalink
Browse files

has_many associations

  • Loading branch information...
1 parent b1c4dca commit 499a53055aab7efa5b646367c6d3936997ab691d @gsterndale gsterndale committed Nov 22, 2011
Showing with 5 additions and 0 deletions.
  1. +1 −0 app/models/organization.rb
  2. +2 −0 app/models/patient.rb
  3. +1 −0 app/models/patient_authorization.rb
  4. +1 −0 app/models/user.rb
@@ -1,2 +1,3 @@
class Organization < ActiveRecord::Base
+ has_many :users
end
View
@@ -1,3 +1,5 @@
class Patient < ActiveRecord::Base
belongs_to :user
+ has_many :patient_authorizations
+ has_many :visits, :through => :patient_authorizations
end
@@ -1,3 +1,4 @@
class PatientAuthorization < ActiveRecord::Base
belongs_to :patient
+ has_many :visits
end
View
@@ -1,3 +1,4 @@
class User < ActiveRecord::Base
belongs_to :organization
+ has_many :patients
end

0 comments on commit 499a530

Please sign in to comment.