ActiveRecord::Base.record_timestamps didn't actually stop timestamps from being updated
This commit is contained in:
parent
5455aedf1d
commit
158401e17d
1 changed files with 2 additions and 2 deletions
|
|
@ -7,7 +7,7 @@ class PhotoStatusMessageAssociationOnGuid < ActiveRecord::Migration
|
||||||
def self.up
|
def self.up
|
||||||
add_column :posts, :status_message_guid, :string
|
add_column :posts, :status_message_guid, :string
|
||||||
|
|
||||||
ActiveRecord::Base.record_timestamps = false
|
Post.record_timestamps = false
|
||||||
photos = Post.where(Post.arel_table[:status_message_id].not_eq(nil).and(Post.arel_table[:type].eq('Photo')))
|
photos = Post.where(Post.arel_table[:status_message_id].not_eq(nil).and(Post.arel_table[:type].eq('Photo')))
|
||||||
photos.each do |photo|
|
photos.each do |photo|
|
||||||
if Post.where(:id => photo.status_message_id).exists?
|
if Post.where(:id => photo.status_message_id).exists?
|
||||||
|
|
@ -27,7 +27,7 @@ class PhotoStatusMessageAssociationOnGuid < ActiveRecord::Migration
|
||||||
def self.down
|
def self.down
|
||||||
add_column :posts, :status_message_id, :integer
|
add_column :posts, :status_message_id, :integer
|
||||||
|
|
||||||
ActiveRecord::Base.record_timestamps = false
|
Post.record_timestamps = false
|
||||||
photos = Post.where(Post.arel_table[:status_message_guid].not_eq(nil).and(Post.arel_table[:type].eq('Photo')))
|
photos = Post.where(Post.arel_table[:status_message_guid].not_eq(nil).and(Post.arel_table[:type].eq('Photo')))
|
||||||
photos.each do |photo|
|
photos.each do |photo|
|
||||||
if Post.where(:guid => photo.status_message_guid).exists?
|
if Post.where(:guid => photo.status_message_guid).exists?
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue