Sha256: b7c74e9ecd06b275d5e1367bb5b198e0c95d79dfbb7fc7fe944d436d30bbe00e

Contents?: true

Size: 365 Bytes

Versions: 7

Compression:

Stored size: 365 Bytes

Contents

class QuestionSweeper < ActionController::Caching::Sweeper
  observe Answer
  include ExpireEditableFragment

  def after_save(record)
    case record.to_s.to_sym
    when :Answer
      record.items.each do |item|
        expire_editable_fragment(item.manifestation, ['detail'])
      end
    end
  end

  def after_destroy(record)
    after_save(record)
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
enju_question-0.0.9 app/models/question_sweeper.rb
enju_question-0.0.8 app/models/question_sweeper.rb
enju_question-0.0.7 app/models/question_sweeper.rb
enju_question-0.0.6 app/models/question_sweeper.rb
enju_question-0.0.5 app/models/question_sweeper.rb
enju_question-0.0.4 app/models/question_sweeper.rb
enju_question-0.0.3 app/models/question_sweeper.rb