Class: BcmsQuestion

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/bcms_question.rb

Constant Summary collapse

EMAIL_PATTERN =

Pattern used to find real emails

/\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\Z/i

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.display_nameObject

display_name is used in the admin secton of the cms to give our content block a readable name



13
14
15
# File 'app/models/bcms_question.rb', line 13

def self.display_name
  "Submitted Questions"
end

Instance Method Details

#before_createObject

When the question is saved make sure it is also published does not make sens to publish a question right?



19
20
21
# File 'app/models/bcms_question.rb', line 19

def before_create
  self.published = true
end