#334 ✓resolved
Joseph Ridgway

Optimistic locks don't work

Reported by Joseph Ridgway | September 25th, 2009 @ 06:45 PM

Note I'm using PostgreSQL. Line 155 in engines/adva_cms/app/controllers/admin/articles_controller.rb evaluates to true when it shouldn't:

if @article.updated_at && (Time.zone.parse(updated_at) != @article.updated_at)

It looks like @article.updated_at includes microseconds. My solution is to convert both to strings before evaluating:

if @article.updated_at && (Time.zone.parse(updated_at).to_s != @article.updated_at.to_s)

This works but might not be the best solution.

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<p>Cutting edge cms, blog, wiki, forum ... plattform.</p>

<p>Find the code on <a href="http://github.com/svenfuchs/adva_cms/tree/master">GitHub: adva cms</a></p>

<p>Part of the business application framework <a href="http://www.advabest.org/">adva best</a>.</p>

Attachments

Pages