I have a class Customer
class Customer < ActiveRecord::Base
enum status: [:unconfirmed]
default_scope { order updated_at: :desc }
scope :unconfirmed, -> { where(status: 0) }
end
Status field in Schema is defined as integer with a default 0.
In development, SQLite, all is working fine but in a production, PostgresSQL, when I try to run Customer.unconfirmed I am getting an error:
PG::UndefinedFunction: ERROR: operator does not exist: boolean = integer
LINE 1: ...s".* FROM "customers" WHERE "customers"."status" = 0 ORDER...
^
HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts.
: SELECT "customers".* FROM "customers" WHERE "customers"."status" = 0 ORDER BY "customers"."updated_at" DESC
ActiveRecord::StatementInvalid: PG::UndefinedFunction: ERROR: operator does not exist: boolean = integer
LINE 1: ...s".* FROM "customers" WHERE "customers"."status" = 0 ORDER...
Can someone help me with finding out what is going on here?