lib/base_repo.rb
# Helper to convert a Ruby Array into a value that postgresql will understand.
#
# @param arr [Array] the array to convert.
# @param array_type [Symbol] the type of array (:integer / :text). Default is :integer.
# @return [Sequel::Postgres::PGArray] Postgres version of the Array.
Helper to convert a Ruby Array into a value that postgresql will understand.
Helper to convert a Ruby Array into a value that postgresql will understand .
def array_for_db_col(arr, array_type: :integer)
    return nil if arr.nil?
    Sequel.pg_array(arr, array_type)
  end
def array_for_db_col ( arr , array_type : :integer ) return nil if arr . nil? Sequel . pg_array ( arr , array_type ) end
Helper to convert a Ruby Array into a value that postgresql will understand.
Helper to convert a Ruby Array into a value that postgresql will understand .
Postgres version of the Array.
Postgres version of the Array .
Sequel::Postgres::PGArray
arr
the array to convert.
the array to convert .
array_type
the type of array (:integer / :text). Default is :integer.
the type of array ( : integer / : text ) . Default is : integer .