diff --git a/app/models/group.rb b/app/models/group.rb index a17f5c3..8b8fa4e 100644 --- a/app/models/group.rb +++ b/app/models/group.rb @@ -1,5 +1,6 @@ class Group < ApplicationRecord has_many :asds has_many :special_events validates :chat_id, uniqueness: true + validates :chat_id, :numericality => {:less_than_or_equal_to => 0 } end diff --git a/app/models/sender.rb b/app/models/sender.rb index ad86ebd..aa00841 100644 --- a/app/models/sender.rb +++ b/app/models/sender.rb @@ -1,4 +1,5 @@ class Sender < ApplicationRecord has_many :asds validates :chat_id, uniqueness: true + validates :chat_id, :numericality => { :greater_than_or_equal_to => 0 } end