aboutsummaryrefslogtreecommitdiffstats
path: root/app/models/concerns/time_table_restrictions.rb
blob: 51576833cb9215f5c97d72c190494b840a3ff596 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
module TimeTableRestrictions
  extend ActiveSupport::Concern

  included do
    include ObjectidRestrictions

    with_options if: :hub_restricted? do |tt|
      # HUB-44
      tt.validate :specific_objectid
      # HUB-45
      #tt.validates_length_of :comment, :maximum => 75, :allow_blank => true, :allow_nil => true
      tt.validates :comment, length: { maximum: 75 }, allow_blank: true
    end
  end
  def specific_objectid
    validate_specific_objectid( 6)
  end
end