Permalink
Browse files

Update Payment source_type to Spree::CreditCard in migration

  • Loading branch information...
1 parent cfad733 commit 4851317e98ae44c20017166ab7887d05ae3f19e0 @joneslee85 joneslee85 committed with radar May 31, 2012
Showing with 6 additions and 0 deletions.
  1. +6 −0 core/db/migrate/20120530012000_rename_creditcards_to_credit_cards.rb
@@ -1,5 +1,11 @@
class RenameCreditcardsToCreditCards < ActiveRecord::Migration
def change
rename_table :spree_creditcards, :spree_credit_cards
+ execute("UPDATE spree_payments SET source_type = 'Spree::CreditCard' WHERE source_type = 'Spree::Creditcard'")
+ end
+
+ def down
+ execute("UPDATE spree_payments SET source_type = 'Spree::Creditcard' WHERE source_type = 'Spree::CreditCard'")
+ rename_table :spree_credit_cards, :spree_creditcards
end
end

0 comments on commit 4851317

Please sign in to comment.