Module: Predicate::Postgres::PgArray
- Defined in:
- lib/predicate/postgres/pg_array.rb,
lib/predicate/postgres/pg_array/empty.rb,
lib/predicate/postgres/pg_array/literal.rb,
lib/predicate/postgres/pg_array/overlaps.rb
Defined Under Namespace
Modules: Empty, Literal, Overlaps
Class Method Summary collapse
Class Method Details
.to_pg_array(arg, type = :varchar) ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/predicate/postgres/pg_array.rb', line 5 def to_pg_array(arg, type = :varchar) if arg.is_a?(Sequel::Postgres::PGArray) arg elsif arg.is_a?(Sequel::SQL::Wrapper) ::Sequel.pg_array(arg.value, type) elsif arg.is_a?(Array) ::Sequel.pg_array(arg, type) elsif arg.respond_to?(:pg_array) arg.pg_array else raise NotSupportedError, "Unexpected pg_array arg `#{arg}`::`#{arg.class}`" end end |