Skip to content

Commit

Permalink
remove not used and wrong attribute: complete from observation resource
Browse files Browse the repository at this point in the history
  • Loading branch information
tsubik committed Oct 22, 2024
1 parent 117637a commit edf2383
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions app/resources/v1/observation_resource.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class ObservationResource < BaseResource
:litigation_status, :location_accuracy, :lat, :lng, :country_id,
:fmu_id, :location_information, :subcategory_id, :severity_id,
:created_at, :updated_at, :actions_taken, :validation_status, :validation_status_id,
:is_physical_place, :complete, :hidden, :user_type, :monitor_comment, :locale
:is_physical_place, :hidden, :user_type, :monitor_comment, :locale

has_many :species
has_many :observation_documents
Expand Down Expand Up @@ -97,17 +97,6 @@ def self.apply_includes(records, directives)
super.includes(:observation_report, :observation_documents, :translations)
end

# An observation is complete if it has evidence
def complete
return true if @model.observation_documents.any?
if @model.evidence_type == "Evidence presented in the report" &&
@model.evidence_on_report && @model.observation_report_id
return true
end

false
end

def validation_status_id
Observation.validation_statuses[@model.validation_status]
end
Expand Down

0 comments on commit edf2383

Please sign in to comment.