Skip to content

Commit

Permalink
params[:good_image_ids]
Browse files Browse the repository at this point in the history
  • Loading branch information
nimmolo committed Jun 26, 2024
1 parent db59541 commit 2e7db71
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion app/controllers/observations_controller/shared_form_methods.rb
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ def try_to_save_image(idx, image, name)

def update_good_images
# Get list of images first.
@good_images = (params[:good_images] || "").split.filter_map do |id|
@good_images = (params[:good_image_ids] || "").split.filter_map do |id|
Image.safe_find(id.to_i)
end

Expand All @@ -228,6 +228,16 @@ def update_good_images
end
end

# For now, this has to read the exif off the actual file on the server.
# This is because the exif data is not stored on the Image record.
def get_exif_data(images)
data = {}
images.each do |image|
data[image.id] = image&.read_exif_geocode || {}
end
data
end

# Now that the observation has been successfully created, we can attach
# any images that were uploaded earlier
def attach_good_images
Expand Down

0 comments on commit 2e7db71

Please sign in to comment.