Sha256: 696794a9cf309ac9494449368985d17792a06de1652c595630a0f2db1127df19

Contents?: true

Size: 431 Bytes

Versions: 22

Compression:

Stored size: 431 Bytes

Contents

module Rostra
  class Answer < ActiveRecord::Base
    include Rostra::EmailNotifier

    belongs_to :question
    belongs_to :user

    acts_as_voteable
    acts_as_commentable

    validates :text, :presence => true

    before_save :create_question_following

    attr_accessor :follow_by_email

    private

    def create_question_following
      question.followers << user unless follow_by_email.to_i.zero?
    end

  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
rostra-0.1.14 app/models/rostra/answer.rb
rostra-0.1.13 app/models/rostra/answer.rb
rostra-0.1.12 app/models/rostra/answer.rb
rostra-0.1.10 app/models/rostra/answer.rb
rostra-0.1.9 app/models/rostra/answer.rb
rostra-0.1.8 app/models/rostra/answer.rb
rostra-0.1.7 app/models/rostra/answer.rb
rostra-0.1.6 app/models/rostra/answer.rb
rostra-0.1.5 app/models/rostra/answer.rb
rostra-0.1.4 app/models/rostra/answer.rb
rostra-0.1.3 app/models/rostra/answer.rb
rostra-0.1.2 app/models/rostra/answer.rb
rostra-0.1.1 app/models/rostra/answer.rb
rostra-0.0.17 app/models/rostra/answer.rb
rostra-0.0.16 app/models/rostra/answer.rb
rostra-0.0.15 app/models/rostra/answer.rb
rostra-0.0.14 app/models/rostra/answer.rb
rostra-0.0.13 app/models/rostra/answer.rb
rostra-0.0.12 app/models/rostra/answer.rb
rostra-0.0.11 app/models/rostra/answer.rb