Class: ActiveRecord::ConnectionAdapters::NullDBAdapter::EmptyResult
- Defined in:
- lib/active_record/connection_adapters/nulldb_adapter/empty_result.rb
Instance Attribute Summary collapse
-
#column_types ⇒ Object
readonly
Returns the value of attribute column_types.
Instance Method Summary collapse
- #>(num) ⇒ Object
- #bind_column_meta(columns) ⇒ Object
- #cast_values(type_overrides = nil) ⇒ Object
- #columns ⇒ Object
- #includes_column?(name) ⇒ Boolean
- #rows ⇒ Object
Instance Attribute Details
#column_types ⇒ Object (readonly)
Returns the value of attribute column_types.
4 5 6 |
# File 'lib/active_record/connection_adapters/nulldb_adapter/empty_result.rb', line 4 def column_types @column_types end |
Instance Method Details
#>(num) ⇒ Object
32 33 34 |
# File 'lib/active_record/connection_adapters/nulldb_adapter/empty_result.rb', line 32 def >(num) rows.size > num end |
#bind_column_meta(columns) ⇒ Object
6 7 8 9 10 11 12 13 14 |
# File 'lib/active_record/connection_adapters/nulldb_adapter/empty_result.rb', line 6 def (columns) @columns = columns return if columns.empty? @column_types = columns.reduce({}) do |ctypes, col| ctypes[col.name] = ActiveRecord::Type.lookup(col.type) ctypes end end |
#cast_values(type_overrides = nil) ⇒ Object
24 25 26 |
# File 'lib/active_record/connection_adapters/nulldb_adapter/empty_result.rb', line 24 def cast_values(type_overrides = nil) rows end |
#columns ⇒ Object
16 17 18 |
# File 'lib/active_record/connection_adapters/nulldb_adapter/empty_result.rb', line 16 def columns @columns ||= [] end |
#includes_column?(name) ⇒ Boolean
36 37 38 |
# File 'lib/active_record/connection_adapters/nulldb_adapter/empty_result.rb', line 36 def includes_column?(name) false end |
#rows ⇒ Object
28 29 30 |
# File 'lib/active_record/connection_adapters/nulldb_adapter/empty_result.rb', line 28 def rows [] end |