don't need xloc or yloc for Synapse mappings
This commit is contained in:
parent
1f1cd37553
commit
5b47527f46
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