Skip to content

Commit

Permalink
Merge pull request #2693 from MushroomObserver/nimmo-observation-and-…
Browse files Browse the repository at this point in the history
…location-scopes

Slight reorganization of Sequence and Observation Query params, remove one duplicate
  • Loading branch information
nimmolo authored Feb 2, 2025
2 parents fb36863 + 3d88da6 commit f7b18aa
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 16 deletions.
1 change: 0 additions & 1 deletion app/classes/query/params/observations.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ def observations_parameter_declarations
user_where: :string,
is_collection_location: :boolean,
with_public_lat_lng: :boolean,
by_user: User,
with_notes: :boolean,
notes_has: :string,
with_notes_fields: [:string],
Expand Down
28 changes: 13 additions & 15 deletions app/classes/query/sequences.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# frozen_string_literal: true

class Query::Sequences < Query::Base
include Query::Params::Locations
include Query::Params::Names
include Query::Params::Observations
include Query::Initializers::Names
Expand All @@ -13,47 +14,44 @@ def model
def parameter_declarations
super.merge(sequence_parameter_declarations).
merge(observation_parameter_declarations).
merge(names_parameter_declarations)
merge(names_parameter_declarations).
merge(bounding_box_parameter_declarations)
end

def sequence_parameter_declarations
{
created_at: [:time],
updated_at: [:time],
observations: [Observation],
ids: [Sequence],
users: [User],
observations: [Observation],
locus: [:string],
archive: [:string],
accession: [:string],
locus_has: :string,
accession_has: :string,
notes_has: :string,
pattern: :string,
ids: [Sequence]
pattern: :string
}
end

def observation_parameter_declarations
{
obs_date: [:date],
observers: [User],
locations: [Location],
herbaria: [Herbarium],
herbarium_records: [HerbariumRecord],
projects: [Project],
species_lists: [SpeciesList],
with_name: :boolean,
confidence: [:float],
north: :float,
south: :float,
east: :float,
west: :float,
locations: [Location],
is_collection_location: :boolean,
with_images: :boolean,
with_name: :boolean,
with_specimen: :boolean,
with_obs_notes: :boolean,
obs_notes_has: :string,
with_notes_fields: [:string],
obs_notes_has: :string
herbaria: [Herbarium],
herbarium_records: [HerbariumRecord],
projects: [Project],
species_lists: [SpeciesList]
}
end

Expand Down

0 comments on commit f7b18aa

Please sign in to comment.