Module: OnForm::Types
- Defined in:
- lib/on_form/types.rb
Defined Under Namespace
Classes: Type
Class Method Summary collapse
- ._adapter ⇒ Object
-
.lookup(type, options) ⇒ Object
for rails 4.2 and below, the type map lives on individual database adapters, but we may not have any models, so here we fall back to the map defined by the abstract adapter class.
Class Method Details
._adapter ⇒ Object
41 42 43 |
# File 'lib/on_form/types.rb', line 41 def self._adapter @_adapter ||= ActiveRecord::ConnectionAdapters::AbstractAdapter.new(nil) end |
.lookup(type, options) ⇒ Object
for rails 4.2 and below, the type map lives on individual database adapters, but we may not have any models, so here we fall back to the map defined by the abstract adapter class.
26 27 28 29 |
# File 'lib/on_form/types.rb', line 26 def self.lookup(type, ) default = .delete(:default) Type.new(ActiveRecord::Type.lookup(type, ), default) end |