Class: Effective::PollQuestion
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Effective::PollQuestion
- Defined in:
- app/models/effective/poll_question.rb
Constant Summary collapse
- CATEGORIES =
[ 'Choose one', # Radios 'Select all that apply', # Checks 'Select upto 1', 'Select upto 2', 'Select upto 3', 'Select upto 4', 'Select upto 5', 'Date', # Date Field 'Email', # Email Field 'Number', # Numeric Field 'Long Answer', # Text Area 'Short Answer', # Text Field 'Upload File' # File field ]
- WITH_OPTIONS_CATEGORIES =
[ 'Choose one', # Radios 'Select all that apply', # Checks 'Select upto 1', 'Select upto 2', 'Select upto 3', 'Select upto 4', 'Select upto 5' ]
Instance Method Summary collapse
Instance Method Details
#category_partial ⇒ Object
71 72 73 |
# File 'app/models/effective/poll_question.rb', line 71 def category_partial category.to_s.parameterize.underscore end |
#poll_question_option? ⇒ Boolean
67 68 69 |
# File 'app/models/effective/poll_question.rb', line 67 def poll_question_option? WITH_OPTIONS_CATEGORIES.include?(category) end |
#to_s ⇒ Object
63 64 65 |
# File 'app/models/effective/poll_question.rb', line 63 def to_s title.presence || 'New Poll Question' end |