Bladeren bron

fixed a bug in user model

jose miguel 7 jaren geleden
bovenliggende
commit
682373a541
1 gewijzigde bestanden met toevoegingen van 2 en 2 verwijderingen
  1. 2 2
      app/models/user.rb

+ 2 - 2
app/models/user.rb

@@ -33,8 +33,8 @@ class User < ActiveRecord::Base
   # validates_presence_of :pointsale_id, message: "Debe seleccionar el punto de venta al que pertenecera el usuario.", on: [:create, :update], unless: :skip_validations_from_pointsale
   validates_presence_of :usertype, message: "Debe seleccionar el tipo de usuario, con este se determinara los permisos que tendrá dentro del sistema.", on: [:create, :update], unless: :skip_validations_from_pointsale
 
-  validates :pointsale_id, presence: { message: "Debe seleccionar un almacén o un punto de venta al que pertenecerá el usuario." }, if: Proc { |c| c.warehouse_id.blank? && c.usertype != 'A' }, on: [:create, :update], unless: :skip_validations_from_pointsale
-  validates :warehouse_id, presence: { message: "Debe seleccionar un almacén o un punto de venta al que pertenecerá el usuario." }, if: Proc { |c| c.pointsale_id.blank? && c.usertype != 'A' }, on: [:create, :update], unless: :skip_validations_from_pointsale
+  validates :pointsale_id, presence: { message: "Debe seleccionar un almacén o un punto de venta al que pertenecerá el usuario." }, if: proc { |c| c.warehouse_id.blank? && c.usertype != 'A' }, on: [:create, :update], unless: :skip_validations_from_pointsale
+  validates :warehouse_id, presence: { message: "Debe seleccionar un almacén o un punto de venta al que pertenecerá el usuario." }, if: proc { |c| c.pointsale_id.blank? && c.usertype != 'A' }, on: [:create, :update], unless: :skip_validations_from_pointsale
 
   validates :userid, uniqueness: { message: "El usuario ya fue utilizado, favor de especificar otro." }