i've got this table:
create_table "packages", force: :cascade do |t|
t.string "sender_type"
t.integer "sender_account_id"
t.integer "sender_user_id"
t.string "address"
t.text "type"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.string "recipients", array: true
end
the recipient array takes the model type and id, separated by a comma, so like ["Manufacturer,4", "Retail,6"].
in my where query, i'm looking to find packages that include any recipients with the word "Manufacturer":
Package.where("sender_type = ? and recipients.include = ?", "school", regex).
just wondering if i'm anywhere close with this