# Table name: user_blocks
#
# id :integer not null, primary key
# Table name: user_blocks
#
# id :integer not null, primary key
# reason :text not null
# ends_at :datetime not null
# needs_view :boolean default(FALSE), not null
# reason :text not null
# ends_at :datetime not null
# needs_view :boolean default(FALSE), not null
validates :deactivates_at, :comparison => { :greater_than_or_equal_to => :ends_at }, :unless => -> { needs_view }
validates :deactivates_at, :absence => true, :if => -> { needs_view }
validates :deactivates_at, :comparison => { :greater_than_or_equal_to => :ends_at }, :unless => -> { needs_view }
validates :deactivates_at, :absence => true, :if => -> { needs_view }