mirror of
https://github.com/moebooru/moebooru
synced 2025-08-22 01:47:48 +00:00
branch : moe extra : convert_revision : svn%3A2d28d66d-8d94-df11-8c86-00306ef368cb/trunk/moe%405
19 lines
335 B
Ruby
19 lines
335 B
Ruby
class IpBans < ActiveRecord::Base
|
|
belongs_to :user, :foreign_key => :banned_by
|
|
|
|
def duration=(dur)
|
|
if not dur or dur == "" then
|
|
self.expires_at = nil
|
|
@duration = nil
|
|
else
|
|
self.expires_at = (dur.to_f * 60*60*24).seconds.from_now
|
|
@duration = dur
|
|
end
|
|
end
|
|
|
|
def duration
|
|
@duration
|
|
end
|
|
end
|
|
|