Class: Uuids::Queries::ByUuid
- Inherits:
-
Hexx::Scope
- Object
- Hexx::Scope
- Uuids::Queries::ByUuid
- Defined in:
- app/queries/by_uuid.rb
Overview
The query selects records by uuids.
Instance Method Summary collapse
-
#initialize(model, *values) ⇒ ByUuid
constructor
Initializes the query object.
-
#select ⇒ ActiveRecord::Relation
Runs and returns the query.
Constructor Details
#initialize(model, *values) ⇒ ByUuid
Initializes the query object.
38 39 40 41 |
# File 'app/queries/by_uuid.rb', line 38 def initialize(model, *values) super(model) @values = values.flatten end |
Instance Method Details
#select ⇒ ActiveRecord::Relation
Runs and returns the query
46 47 48 |
# File 'app/queries/by_uuid.rb', line 46 def select values.any? ? by_uuid : model.all end |