blob: e8d5d203d746cb99b97500bc41990641f397636c (
plain)
| 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
 | module JourneyPatternRestrictions
  extend ActiveSupport::Concern
  included do
    include ObjectidRestrictions
    with_options if: :hub_restricted? do |jp|
      # HUB-39
      jp.validate :specific_objectid
      # HUB-40
      jp.validates :registration_number, numericality: { less_than: 10 ** 8 }
      # HUB-41
      #jp.validates_length_of :name, :maximum => 75, :allow_blank => true, :allow_nil => true
      jp.validates :name, length: { maximum: 75 }, allow_blank: true
    end
  end
  def specific_objectid
    validate_specific_objectid( 30)
  end
end
 |