Skip to content

Commit

Permalink
Clean up User association definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
Nitemaeric committed Jan 3, 2024
1 parent 1db3ad8 commit 3b833ae
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions app/models/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,11 @@
#
class User < ApplicationRecord
has_many :memberships
has_many :schools,
through: :memberships,
source: :organisation,
source_type: "School"
has_many :providers,
through: :memberships,
source: :organisation,
source_type: "Provider"

enum :service,
{ no_service: "no_service", claims: "claims", placements: "placements" },
validate: true
has_many :schools, through: :memberships, source: :organisation, source_type: "School"
has_many :providers, through: :memberships, source: :organisation, source_type: "Provider"

enum :service, { no_service: "no_service", claims: "claims", placements: "placements" }, validate: true

validates :first_name, presence: true
validates :last_name, presence: true
Expand Down

0 comments on commit 3b833ae

Please sign in to comment.