app/services/listing_service/store/listing.rb
def where_models(community_id, query)
    ar_query = ListingModel
      .where(community_id: community_id)

    ar_query =
      if query[:open] == true
        ar_query.currently_open
      elsif query[:open] == false
        raise NotImplementedError.new("Count of closed listings is not implemented")
      else
        ar_query
      end

    ar_query.where(query.except(:open))
  end
# Construct ActiveRecord query based on community_id and the
# query params
Construct ActiveRecord query based on community_id and the
query params
Construct ActiveRecord query based on community_id and the query params
def where_models(community_id, query)
    ar_query = ListingModel
      .where(community_id: community_id)
    ar_query =
      if query[:open] == true
        ar_query.currently_open
      elsif query[:open] == false
        raise NotImplementedError.new("Count of closed listings is not implemented")
      else
        ar_query
      end
    ar_query.where(query.except(:open))
  end
def where_models ( community_id , query ) ar_query = ListingModel . where ( community_id : community_id ) ar_query = if query [ :open ] == true ar_query . currently_open elsif query [ :open ] == false raise NotImplementedError . new ( "Count of closed listings is not implemented" ) else ar_query end ar_query . where ( query . except ( :open ) ) end
Construct ActiveRecord query based on community_id and the
query params
Construct ActiveRecord query based on community_id and the query params
community_id
query