Fixed a couple of queries (#3233)
This commit is contained in:
parent
c413cf8235
commit
6ce6b265df
1 changed files with 6 additions and 3 deletions
|
|
@ -83,9 +83,12 @@ class ClassifiedListingsController < ApplicationController
|
|||
end
|
||||
|
||||
def dashboard
|
||||
@classified_listings = ClassifiedListing.where(user_id: current_user.id)
|
||||
@orgs = Organization.where(id: current_user.organization_memberships.where(type_of_user: "admin").map(&:organization_id))
|
||||
@org_listings = ClassifiedListing.where(organization_id: current_user.organization_memberships.where(type_of_user: "admin").map(&:organization_id))
|
||||
@classified_listings = current_user.classified_listings
|
||||
organizations_ids = current_user.organization_memberships.
|
||||
where(type_of_user: "admin").
|
||||
pluck(:organization_id)
|
||||
@orgs = Organization.where(id: organizations_ids)
|
||||
@org_listings = ClassifiedListing.where(organization_id: organizations_ids)
|
||||
@user_credits = current_user.unspent_credits_count
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue