Sha256: 75915be5103272f43ecb5c304cf8586c0444ad047961e0b36372ca3e50c8fed4

Contents?: true

Size: 774 Bytes

Versions: 13

Compression:

Stored size: 774 Bytes

Contents

class AgentSweeper < ActionController::Caching::Sweeper
  include ExpireEditableFragment
  observe Agent

  def after_save(record)
    expire_editable_fragment(record)
    record.works.each do |work|
      expire_editable_fragment(work)
    end
    record.expressions.each do |expression|
      expire_editable_fragment(expression)
    end
    record.manifestations.each do |manifestation|
      expire_editable_fragment(manifestation)
    end
    record.donated_items.each do |item|
      expire_editable_fragment(item)
    end
    record.original_agents.each do |agent|
      expire_editable_fragment(agent)
    end
    record.derived_agents.each do |agent|
      expire_editable_fragment(agent)
    end
  end

  def after_destroy(record)
    after_save(record)
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
enju_biblio-0.1.0.pre55 app/models/agent_sweeper.rb
enju_biblio-0.1.0.pre54 app/models/agent_sweeper.rb
enju_biblio-0.1.0.pre53 app/models/agent_sweeper.rb
enju_biblio-0.1.0.pre52 app/models/agent_sweeper.rb
enju_biblio-0.1.0.pre51 app/models/agent_sweeper.rb
enju_biblio-0.1.0.pre50 app/models/agent_sweeper.rb
enju_biblio-0.1.0.pre49 app/models/agent_sweeper.rb
enju_biblio-0.1.0.pre48 app/models/agent_sweeper.rb
enju_biblio-0.1.0.pre47 app/models/agent_sweeper.rb
enju_biblio-0.1.0.pre46 app/models/agent_sweeper.rb
enju_biblio-0.1.0.pre45 app/models/agent_sweeper.rb
enju_biblio-0.1.0.pre44 app/models/agent_sweeper.rb
enju_biblio-0.1.0.pre43 app/models/agent_sweeper.rb