Merge pull request #2072 from ligthyear/fix-edit-body-too-similar-issue

Be more liberal when users wants to change their own body to a previous version
This commit is contained in:
Régis Hanol 2014-03-07 11:38:59 +01:00
commit dbb383497c

View file

@ -101,12 +101,13 @@ class Post < ActiveRecord::Base
def store_unique_post_key
if SiteSetting.unique_posts_mins > 0
$redis.setex(unique_post_key, SiteSetting.unique_posts_mins.minutes.to_i, "1")
$redis.setex(unique_post_key, SiteSetting.unique_posts_mins.minutes.to_i, id)
end
end
def matches_recent_post?
$redis.exists(unique_post_key)
post_id = $redis.get(unique_post_key)
post_id != nil and post_id != id
end
def raw_hash