Skip to content

Commit

Permalink
Minor typos
Browse files Browse the repository at this point in the history
  • Loading branch information
ut committed Dec 20, 2024
1 parent 2e45679 commit 92f09c7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
1 change: 0 additions & 1 deletion app/models/layer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ def strip_exif_data

return unless image.attached? && image.changed? && attachment_changes['image']

filename = image.filename.to_s
attachment_path = "#{Dir.tmpdir}/#{image.filename}"
tmp_new_image = File.read(attachment_changes['image'].attachable[:io])
File.open(attachment_path, 'wb') do |tmp_file|
Expand Down
6 changes: 2 additions & 4 deletions app/models/place.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
require 'csv'

class Place < ApplicationRecord
# self.skip_time_zone_conversion_for_attributes = [:startdate,:startdate_date,:startdate_time]

belongs_to :layer
belongs_to :icon, optional: true

Expand All @@ -20,15 +18,15 @@ class Place < ApplicationRecord
dependent: :destroy
accepts_nested_attributes_for :relations_tos, allow_destroy: true
accepts_nested_attributes_for :relations_froms, allow_destroy: true
accepts_nested_attributes_for :annotations, reject_if: ->(a) { a[:title].blank? }, allow_destroy: true

has_many :images, dependent: :destroy
has_many :videos, dependent: :destroy
has_many :submissions, dependent: :destroy
has_many :annotations
accepts_nested_attributes_for :annotations, reject_if: ->(a) { a[:title].blank? }, allow_destroy: true

validates :title, presence: true
validate :check_audio_format
validates :title, presence: true
validates :lat, presence: true, format: { with: /\A-?\d+(\.\d+)?\z/, message: 'should be a valid latitude value' }
validates :lon, presence: true, format: { with: /\A-?\d+(\.\d+)?\z/, message: 'should be a valid longitude value' }
validates :lat, presence: true, numericality: { greater_than_or_equal_to: -90, less_than_or_equal_to: 90 }
Expand Down

0 comments on commit 92f09c7

Please sign in to comment.