Class: ActiveRecord::Validations::TypedColumn

Inherits:
SimpleDelegator
  • Object
show all
Defined in:
lib/active_record/validations/typed_column.rb

Instance Method Summary collapse

Instance Method Details

#binary?Boolean

Returns:

  • (Boolean)


24
25
26
27
28
29
30
# File 'lib/active_record/validations/typed_column.rb', line 24

def binary?
  if __getobj__.respond_to?(:binary?)
    super
  else
    type == :binary
  end
end

#number?Boolean

Returns:

  • (Boolean)


8
9
10
11
12
13
14
# File 'lib/active_record/validations/typed_column.rb', line 8

def number?
  if __getobj__.respond_to?(:number?)
    super
  else
    type == :decimal || type == :integer
  end
end

#text?Boolean

Returns:

  • (Boolean)


16
17
18
19
20
21
22
# File 'lib/active_record/validations/typed_column.rb', line 16

def text?
  if __getobj__.respond_to?(:text?)
    super
  else
    type == :text || type == :string
  end
end