Skip to content
This repository has been archived by the owner on Jan 3, 2021. It is now read-only.

Commit

Permalink
Citylife isn't compatible with other card types
Browse files Browse the repository at this point in the history
  • Loading branch information
VandorpeDavid committed Aug 28, 2016
1 parent 3e20fc5 commit 4118cbf
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/models/club.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ class Club < ActiveRecord::Base
errors.add(:base, 'Er moet een kaarttype geselecteerd zijn.') unless uses_fk || uses_isic || uses_citylife
end

validate do |club|
errors.add(:base, 'CityLife is niet compatibel met andere kaarttypes') if uses_isic && (uses_fk || uses_citylife)
end


default_scope { order(:full_name) }
scope :visible, -> { where.not(:registration_method => :hidden) }
Expand Down

0 comments on commit 4118cbf

Please sign in to comment.