Sha256: 322f034993fb850c299dbd4830c23dc17ec4f63be4804b67d5316796d8682192
Contents?: true
Size: 433 Bytes
Versions: 21
Compression:
Stored size: 433 Bytes
Contents
class UpdateNameFieldsOnSpreeCreditCards < ActiveRecord::Migration[4.2] 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
21 entries across 21 versions & 1 rubygems