limit the amount of people in a converasation to prevent hella spam
This commit is contained in:
parent
d3487c8b7d
commit
d331a14dd2
1 changed files with 6 additions and 0 deletions
|
|
@ -14,6 +14,12 @@ class Conversation < ActiveRecord::Base
|
||||||
|
|
||||||
belongs_to :author, :class_name => 'Person'
|
belongs_to :author, :class_name => 'Person'
|
||||||
|
|
||||||
|
validate :max_participants
|
||||||
|
|
||||||
|
def max_participants
|
||||||
|
errors.add(:max_participants, "too many participants") if participants.count > 20
|
||||||
|
end
|
||||||
|
|
||||||
accepts_nested_attributes_for :messages
|
accepts_nested_attributes_for :messages
|
||||||
|
|
||||||
def recipients
|
def recipients
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue