mirror of
https://github.com/TracksApp/tracks.git
synced 2026-01-04 16:28:50 +01:00
Don't use dynamic finders in this migration.
For whatever reason, the dynamic finders aren't available in this
migration and so the migration fails. Converting to find(:all,
:conditions => {...}) prevents this from not failing.
This commit is contained in:
parent
a97384f318
commit
598891c1d3
1 changed files with 5 additions and 4 deletions
|
|
@ -1,19 +1,20 @@
|
|||
class SetNilTimestamps < ActiveRecord::Migration
|
||||
|
||||
class Project < ActiveRecord::Base; end
|
||||
|
||||
class Context < ActiveRecord::Base; end
|
||||
|
||||
def self.up
|
||||
Project.find_all_by_created_at(nil).each do |p|
|
||||
Project.find(:all, :conditions => { :created_at => nil }).each do |p|
|
||||
Project.update( p.id, {:created_at => Time.now.utc} )
|
||||
end
|
||||
Project.find_all_by_updated_at(nil).each do |p|
|
||||
Project.find(:all, :conditions => { :created_at => nil }).each do |p|
|
||||
Project.update( p.id, {:updated_at => Time.now.utc} )
|
||||
end
|
||||
Context.find_all_by_created_at(nil).each do |p|
|
||||
Context.find(:all, :conditions => { :created_at => nil }).each do |p|
|
||||
Context.update( p.id, {:created_at => Time.now.utc} )
|
||||
end
|
||||
Context.find_all_by_updated_at(nil).each do |p|
|
||||
Context.find(:all, :conditions => { :created_at => nil }).each do |p|
|
||||
Context.update( p.id, {:updated_at => Time.now.utc} )
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue