You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Kept running into this error and didn't know why. Finally figured it's this gem's problem.
Getting this error when calling total entries or just looping through @profiles
PG::UndefinedFunction: ERROR: could not identify an equality operator for type profiles
LINE 1: SELECT COUNT(DISTINCT profiles.*) AS count_profiles_all, pro...
^
: SELECT COUNT(DISTINCT profiles.*) AS count_profiles_all, profiles.id, profiles.email AS profiles_id_profiles_email FROM "profiles" LEFT OUTER JOIN "tags" ON "tags"."profile_id" = "profiles"."id" INNER JOIN "integration_profiles" ON "profiles"."id" = "integration_profiles"."profile_id" WHERE "integration_profiles"."integration_id" = $1 AND (("tags"."tag_name" ILIKE '%toronto%')) AND "profiles"."found" = 't' GROUP BY profiles.id, profiles.email
Currently I have model:
class Integration < ActiveRecord::Base
belongs_to :user
has_many :integration_profiles
has_many :profiles, through: :integration_profiles
end
class Profile < ActiveRecord::Base
has_many :integration_profiles
has_many :integrations, through: :integration_profiles
has_many :users, through: :integrations
belongs_to :api_client
has_many :tags
end
class Tag < ActiveRecord::Base
belongs_to :user
belongs_to :profile
end
In my IntegrationController
def show
@integration = current_user.integrations.find(params[:id])
@q = @integration.profiles.search(search_params)
@profiles = @q.result.where(found: true).select("profiles.*").group("profiles.id, profiles.email").includes(:integration_profiles).order("CAST( translate(meta_data -> '#{params[:sort_by]}', ',', '') AS INT) DESC NULLS LAST")
end
It fails everytime but with some work in console, I found if I add .count("profiles.id") makes the count work. So I had to patch and do add at the end of my show action:
Likely fixed by #372 just the other day. No release yet, though. Can you temporarily upgrade will_paginate in your Gemfile to version from git master branch and see if it goes away?
Kept running into this error and didn't know why. Finally figured it's this gem's problem.
Getting this error when calling total entries or just looping through @profiles
Currently I have model:
In my
IntegrationController
It fails everytime but with some work in console, I found if I add
.count("profiles.id")
makes the count work. So I had to patch and do add at the end of my show action:The text was updated successfully, but these errors were encountered: