Class: RatingQuestion
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- RatingQuestion
- Defined in:
- app/models/rating_question.rb
Class Method Summary collapse
-
.get_all_rating_questions ⇒ Object
Get All Rating Question.
Instance Method Summary collapse
Class Method Details
.get_all_rating_questions ⇒ Object
Get All Rating Question
13 14 15 16 17 18 19 |
# File 'app/models/rating_question.rb', line 13 def self. = RatingQuestion.pluck(:id, :category, :question).map {|id, category, question| {id: id, category: category, question: question.upcase}} = .group_by{ |d| d[:category] }.map{|c, q| {category: c, question: q}}.take(3) .each do || [:question] = [:question].take(3) end end |
Instance Method Details
#name ⇒ Object
8 9 10 |
# File 'app/models/rating_question.rb', line 8 def name question end |