Class: Hyrax::Statistics::ValkyrieQueryService
Instance Method Summary
collapse
#build_date_query, #where_public, #where_registered
Instance Method Details
#find_by_date_created(start_datetime, end_datetime = nil) ⇒ Object
query to find works created during the time range
8
9
10
11
12
13
14
15
|
# File 'app/services/hyrax/statistics/valkyrie_query_service.rb', line 8
def find_by_date_created(start_datetime, end_datetime = nil)
return [] if start_datetime.blank? return super unless non_wings_valkyire?
Hyrax.query_service.custom_queries.find_by_date_range(start_datetime: start_datetime,
end_datetime: end_datetime,
models: relation.allowable_types).to_a
end
|
#find_public_in_date_range(start_datetime, end_datetime = nil) ⇒ Object
22
23
24
25
|
# File 'app/services/hyrax/statistics/valkyrie_query_service.rb', line 22
def find_public_in_date_range(start_datetime, end_datetime = nil)
return super unless non_wings_valkyire?
find_by_date_created(start_datetime, end_datetime) & where_public.to_a
end
|
#find_registered_in_date_range(start_datetime, end_datetime = nil) ⇒ Object
17
18
19
20
|
# File 'app/services/hyrax/statistics/valkyrie_query_service.rb', line 17
def find_registered_in_date_range(start_datetime, end_datetime = nil)
return super unless non_wings_valkyire?
find_by_date_created(start_datetime, end_datetime) & where_registered.to_a
end
|
#relation ⇒ Object
27
28
29
30
|
# File 'app/services/hyrax/statistics/valkyrie_query_service.rb', line 27
def relation
return super unless non_wings_valkyire?
Hyrax::ValkyrieWorkRelation.new
end
|