≡

wincent.dev

  • Products
  • Blog
  • Wiki
  • Issues
You are viewing an historical archive of past issues. Please report new issues to the appropriate project issue tracker on GitHub.
Home » Issues » Bug #1322

Bug #1322: Moderation doesn't trigger sweepers

Kind bug
Product wincent.dev
When 2009-06-21T07:55:12Z
Status closed
Reporter Greg Hurrell
Tags no tags

Description

  1. User views tweets#show
  2. HTML page gets cached
  3. Anonymous visitor comments
  4. Comment is held for moderation
  5. Administrator moderates comment as ham
  6. Sweepers don't run, so HTML page doesn't get expired
  7. Next visitor views HTML page and doesn't see comment

Comments

  1. Greg Hurrell 2009-06-21T07:55:19Z

    Status changed:

    • From: new
    • To: open
  2. Greg Hurrell 2009-06-21T08:21:48Z

    Ok, I've committed a "quick and dirty" fix so that I can go ahead and deploy.

    Will look into a more elegant solution (new Rails functionality for updated records without touching timestamps) subsequently.

  3. Greg Hurrell 2009-06-21T14:38:13Z

    I am pretty sure I've seen a new API for this but I can't find it... only these old discussions:

    • http://stackoverflow.com/questions/861448/is-there-a-way-to-avoid-automatically-updating-rails-timestamp-fields
    • http://blog.evanweaver.com/articles/2006/12/26/hacking-activerecords-automatic-timestamps/
  4. Greg Hurrell 2009-06-21T14:57:37Z

    I think I might have found the thing I was thinking of here:

    You can now specify a particular timestamp for updated_at timestamps: cust = Customer.create(:name => "ABC Industries", :updated_at => 1.day.ago) (commit)

    Looks like that won't help as it only applies to the create method.

    Trying model.update_attributes :awaiting_moderation => false, :updated_at => model.updated_at won't work anyway because updated_at is a protected attribute.

    This won't work either (new timestamp gets written out anyway):

    model.awaiting_moderation = false
    model.updated_at = model.updated_at

    So looks like temporarily doing Model.record_timestamps = false might be the only way to do it, and that will obviously only work as long as I run Rails in single-threaded mode.

  5. Greg Hurrell 2009-06-21T15:12:58Z

    Ok, have implemented my preferred fix for now. Marking as closed.

  6. Greg Hurrell 2009-06-21T15:13:57Z

    Status changed:

    • From: open
    • To: closed
Add a comment

Comments are now closed for this issue.

  • contact
  • legal

Menu

  • Blog
  • Wiki
  • Issues
  • Snippets