Skip to content

Commit

Permalink
Addressed an issue with Place.rb (Terrastories#449)
Browse files Browse the repository at this point in the history
* Update seeds.rb

Stories were not loading properly: They needed at least one associated speaker to pass validation.

Co-authored-by: Ian <ian.norris.1991@gmail.com>
Co-authored-by: Oliver <o.hamuy@wustl.edu>
Co-authored-by: Katherine <kfhenry@wustl.edu>
Co-authored-by: maebeale <maebeale@gmail.com>

* Added bounds to the lat and long variables

This addresses issue Terrastories#442, and prevents users from editing places such that their lat and long variables exceed the normal bounds to latitudinal and longitudinal coordinates

Co-authored-by: Ian <ian.norris.1991@gmail.com>
Co-authored-by: Oliver <o.hamuy@wustl.edu>
Co-authored-by: Katherine <kfhenry@wustl.edu>
Co-authored-by: maebeale <maebeale@gmail.com>
  • Loading branch information
5 people committed Jun 28, 2020
1 parent 0df05b5 commit 262d12f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions rails/app/models/place.rb
Expand Up @@ -5,6 +5,8 @@ class Place < ApplicationRecord
has_and_belongs_to_many :stories
has_one_attached :photo
validate :photo_format
validates :lat, numericality: { greater_than_or_equal_to: -90, less_than_or_equal_to: 90 }
validates :long, numericality: { greater_than_or_equal_to: -180, less_than_or_equal_to: 180 }
has_many :interview_stories, class_name: "Story", foreign_key: "interview_location_id"

attr_reader :point_geojson
Expand Down

0 comments on commit 262d12f

Please sign in to comment.