5
6
7
8
9
10
11
12
13
14
|
# File 'lib/surveyor_gui/models/answer_methods.rb', line 5
def self.included(base)
base.send :belongs_to, :question
base.send :has_many, :responses
base.send :belongs_to, :column
base.send :default_scope, lambda { base.order('display_order') }
base.send :attr_accessible, :text, :response_class, :display_order, :original_choice, :hide_label, :question_id,
:display_type, :is_comment, :column if defined? ActiveModel::MassAssignmentSecurity
base.send :scope, :is_not_comment, -> { base.where(is_comment: false) }
base.send :scope, :is_comment, -> { base.where(is_comment: true) }
end
|