Sha256: 6abf3a45b8a395cfc5cb3cdbedd64fac6b976896004670b2332c07e2ac15d52b
Contents?: true
Size: 428 Bytes
Versions: 5
Compression:
Stored size: 428 Bytes
Contents
class UpdateNameFieldsOnSpreeCreditCards < ActiveRecord::Migration def up if ActiveRecord::Base.connection.adapter_name.downcase.include? "mysql" execute "UPDATE spree_credit_cards SET name = CONCAT_WS(' ', first_name, last_name)" else execute "UPDATE spree_credit_cards SET name = first_name || ' ' || last_name" end end def down execute "UPDATE spree_credit_cards SET name = NULL" end end
Version data entries
5 entries across 5 versions & 1 rubygems