fixes #1699
This commit is contained in:
@@ -276,8 +276,8 @@ class Pool < ActiveRecord::Base
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def create_version
|
def create_version(force = false)
|
||||||
if post_ids_changed? || name_changed? || description_changed? || is_active_changed? || is_deleted_changed? || category_changed?
|
if post_ids_changed? || name_changed? || description_changed? || is_active_changed? || is_deleted_changed? || category_changed? || force
|
||||||
last_version = versions.last
|
last_version = versions.last
|
||||||
|
|
||||||
if last_version && CurrentUser.ip_addr == last_version.updater_ip_addr && CurrentUser.id == last_version.updater_id
|
if last_version && CurrentUser.ip_addr == last_version.updater_ip_addr && CurrentUser.id == last_version.updater_id
|
||||||
|
|||||||
11
script/fixes/015.rb
Normal file
11
script/fixes/015.rb
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
#!/usr/bin/env ruby
|
||||||
|
|
||||||
|
require File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'config', 'environment'))
|
||||||
|
|
||||||
|
ActiveRecord::Base.connection.execute("set statement_timeout = 0")
|
||||||
|
|
||||||
|
Pool.find_each do |pool|
|
||||||
|
if pool.versions.count == 0
|
||||||
|
pool.create_version(true)
|
||||||
|
end
|
||||||
|
end
|
||||||
Reference in New Issue
Block a user