lib/queries/source/filter.rb
# TODO: likely move to model (replicated in Source too)
# Params exists for all CollectingEvent attributes except these
likely move to model (replicated in Source too)
Params exists for all CollectingEvent attributes except these
likely move to model ( replicated in Source too ) Params exists for all CollectingEvent attributes except these
def in_project_facet
        return nil if project_id.nil? || in_project.nil?
        if in_project
          ::Source.joins(:project_sources)
            .where(project_sources: {project_id: project_id})
        else
          ::Source.left_outer_joins(:project_sources)
            .where("project_sources.project_id != ? OR project_sources.id IS NULL", Current.project_id)
            .distinct
        end
      end
def in_project_facet return nil if project_id . nil? || in_project . nil? if in_project :: Source . joins ( :project_sources ) . where ( project_sources : { project_id : project_id } ) else :: Source . left_outer_joins ( :project_sources ) . where ( "project_sources.project_id != ? OR project_sources.id IS NULL" , Current . project_id ) . distinct end end
TODO: likely move to model (replicated in Source too)
Params exists for all CollectingEvent attributes except these
TODO : likely move to model ( replicated in Source too ) Params exists for all CollectingEvent attributes except these