forked from fullware/socialactions
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Doug Puchalski
committed
Feb 1, 2011
1 parent
40b15b2
commit 5e54859
Showing
10 changed files
with
30 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
class RemoveDctermsValid < ActiveRecord::Migration | ||
def self.up | ||
# Remove bad dcterms_valid fields | ||
Action.scoped(:conditions => "dcterms_valid = 'donate'").all.each do |a| | ||
a.dcterms_valid = nil | ||
a.save | ||
end | ||
|
||
Action.scoped(:conditions => 'dcterms_valid IS NOT NULL').all.each do |a| | ||
dt = DateTime.parse(a.dcterms_valid.sub(/end=/, '')) | ||
p "#{a.id} #{a.dcterms_valid} #{dt}" | ||
a.expires_at = dt | ||
a.dcterms_valid = nil | ||
a.save | ||
end; nil | ||
|
||
remove_column :actions, :dcterms_valid | ||
end | ||
|
||
def self.down | ||
add_column :actions, :dcterms_valid, :string | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters