Merge pull request #474 from metamaps/feature/fix-synapse-mappings
don't need xloc or yloc for Synapse mappings
This commit is contained in:
commit
cb43ebce92
1 changed files with 4 additions and 2 deletions
|
@ -7,8 +7,10 @@ class Mapping < ActiveRecord::Base
|
|||
belongs_to :map, :class_name => "Map", :foreign_key => "map_id", touch: true
|
||||
belongs_to :user
|
||||
|
||||
validates :xloc, presence: true
|
||||
validates :yloc, presence: true
|
||||
validates :xloc, presence: true,
|
||||
unless: Proc.new { |m| m.mappable_type == 'Synapse' }
|
||||
validates :yloc, presence: true,
|
||||
unless: Proc.new { |m| m.mappable_type == 'Synapse' }
|
||||
validates :map, presence: true
|
||||
validates :mappable, presence: true
|
||||
|
||||
|
|
Loading…
Reference in a new issue