af83/chouette-core

View on GitHub
app/lib/query/control_list_run.rb

Summary

Maintainability
A
0 mins
Test Coverage
module Query
  class ControlListRun < Query::Operation
    def name(value)
      where(value, :matches, :name)
    end

    def referential_name(value)
      change_scope(if: value.present?) do |scope|
        scope.joins(:referential).where('referentials.name LIKE ?', "%#{value}%")
      end
    end
  end
end