class UserBlock < ActiveRecord::Base
validate :moderator_permissions
+ validates :reason, :characters => true
belongs_to :user, :class_name => "User", :foreign_key => :user_id
belongs_to :creator, :class_name => "User", :foreign_key => :creator_id
# revokes the block, allowing the user to use the API again. the argument
# is the user object who is revoking the ban.
def revoke!(revoker)
- update_attributes(
+ update(
:ends_at => Time.now.getutc,
:revoker_id => revoker.id,
:needs_view => false