don't need xloc or yloc for Synapse mappings
This commit is contained in:
parent
40a833b069
commit
b385efafa9
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