Class: ModWarning

Inherits:
ApplicationRecord show all
Defined in:
app/models/mod_warning.rb

Instance Method Summary collapse

Methods inherited from ApplicationRecord

#attributes_print, fuzzy_search, match_search, #match_search, sanitize_for_search, sanitize_name, sanitize_sql_in, useful_err_msg, with_lax_group_rules

Instance Method Details

#body_as_htmlObject



12
13
14
# File 'app/models/mod_warning.rb', line 12

def body_as_html
  ApplicationController.helpers.render_markdown(body)
end

#suspension_active?Boolean

Returns:

  • (Boolean)


8
9
10
# File 'app/models/mod_warning.rb', line 8

def suspension_active?
  active && is_suspension && !suspension_end.past?
end

#suspension_durationObject

These two are necessary for the new warning form to work.



17
18
19
# File 'app/models/mod_warning.rb', line 17

def suspension_duration
  1
end

#suspension_public_noticeObject



21
22
23
# File 'app/models/mod_warning.rb', line 21

def suspension_public_notice
  nil
end