app/models/user.rb
# The user may be author of question/questionnaire

The user may be author of question/questionnaire
The user may be author of question / questionnaire
def last_10_questionnaires
    last_10 = Questionnaire.last_10_published(I18n.locale)
    last_10.all.map { |q|
      {
          :id       => q.id,
          :date     => q.created_at,
          :title    => q.title,
          :answered => q.answered_questionnaire?(self)
      }
    }
  end
def last_10_questionnaires last_10 = Questionnaire . last_10_published ( I18n . locale ) last_10 . all . map { | q | { :id => q . id , :date => q . created_at , :title => q . title , :answered => q . answered_questionnaire? ( self ) } } end
The user may be author of question/questionnaire
The user may be author of question / questionnaire