Class: Mist::PostSweeper
- Inherits:
-
ActionController::Caching::Sweeper
- Object
- ActionController::Caching::Sweeper
- Mist::PostSweeper
- Defined in:
- app/models/mist/post_sweeper.rb
Instance Method Summary collapse
- #after_destroy(post) ⇒ Object
- #after_save(post) ⇒ Object
- #before_save(post) ⇒ Object
- #bust!(post) ⇒ Object
- #bust_post!(post, options) ⇒ Object
- #touched_posts(post) ⇒ Object
Instance Method Details
#after_destroy(post) ⇒ Object
8 9 10 |
# File 'app/models/mist/post_sweeper.rb', line 8 def after_destroy(post) bust! post end |
#after_save(post) ⇒ Object
4 5 6 |
# File 'app/models/mist/post_sweeper.rb', line 4 def after_save(post) bust! post end |
#before_save(post) ⇒ Object
12 13 14 |
# File 'app/models/mist/post_sweeper.rb', line 12 def before_save(post) @tags_were = post. end |
#bust!(post) ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'app/models/mist/post_sweeper.rb', line 16 def bust!(post) expire_page :action => 'feed', :format => 'atom' touched = touched_posts post each_combo(Mist.) do || .keys.each { |key| .delete(key) unless [key] } expire_page .merge(:action => 'index') bust_post! post, touched.each { |p| bust_post! p, } end end |
#bust_post!(post, options) ⇒ Object
29 30 31 |
# File 'app/models/mist/post_sweeper.rb', line 29 def bust_post!(post, ) expire_action .merge(:action => 'show', :id => post.id) end |