Class: Arel::Table

Inherits:
Object show all
Defined in:
lib/brick/extensions.rb

Instance Method Summary collapse

Instance Method Details

#_arel_table_typeObject



48
49
50
51
52
53
54
55
56
# File 'lib/brick/extensions.rb', line 48

def _arel_table_type
  # AR < 4.2 doesn't have type_caster at all, so rely on an instance variable getting set
  # AR 4.2 - 5.1 have buggy type_caster entries for the root node
  instance_variable_get(:@_arel_table_type) ||
  # 5.2-7.0 does type_caster just fine, no bugs there, but the property with the type differs:
  # 5.2 has "types" as public, 6.0 "types" as private, and >= 6.1 "klass" as private.
  ((tc = send(:type_caster)) && tc.instance_variable_get(:@types)) ||
  tc.send(:klass)
end