The Sequel gem qualified query column name with table double underscores

The answer is to actually qualify the column name using:

Sequel.qualify(:table, :column)

Or the equivalent shorter syntax:

Sequel[:table][:column]

resulting in:

employees = DB[:prm_master__employee.identifier]
.join(:prm_master__employee_custom_fields.identifier, :employee => :employee)
.where("termination_date >= ?","06/01/2012")
.or("termination_date = NULL")
.and(Sequel.qualify(:prm_master__employee_custom_fields.identifier, :employee)  => "holderl")

Tags:

Ruby

Sequel