Sha256: d4894aca138e3b218035d3ae44162ec3a591ffdaa7242509e2921304c5553f58

Contents?: true

Size: 476 Bytes

Versions: 12

Compression:

Stored size: 476 Bytes

Contents

class TokensForLegacyOrders < ActiveRecord::Migration
  def up
    Spree::TokenizedPermission.table_name = 'tokenized_permissions'

    # add token permissions for legacy orders (stop relying on user persistence token)
    Spree::Order.all.each do |order|
      next unless order.user
      order.create_tokenized_permission(:token => order.user.persistence_token)
    end

    Spree::TokenizedPermission.table_name = 'spree_tokenized_permissions'
  end

  def down
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
spree_auth-1.0.7 db/migrate/20101219201531_tokens_for_legacy_orders.rb
spree_auth-1.0.6 db/migrate/20101219201531_tokens_for_legacy_orders.rb
spree_auth-1.0.5 db/migrate/20101219201531_tokens_for_legacy_orders.rb
spree_auth-1.0.4 db/migrate/20101219201531_tokens_for_legacy_orders.rb
spree_auth-1.0.3 db/migrate/20101219201531_tokens_for_legacy_orders.rb
spree_auth-1.0.2 db/migrate/20101219201531_tokens_for_legacy_orders.rb
spree_auth-1.0.1 db/migrate/20101219201531_tokens_for_legacy_orders.rb
spree_auth-1.0.0 db/migrate/20101219201531_tokens_for_legacy_orders.rb
spree_auth-1.0.0.rc4 db/migrate/20101219201531_tokens_for_legacy_orders.rb
spree_auth-1.0.0.rc3 db/migrate/20101219201531_tokens_for_legacy_orders.rb
spree_auth-1.0.0.rc2 db/migrate/20101219201531_tokens_for_legacy_orders.rb
spree_auth-1.0.0.rc1 db/migrate/20101219201531_tokens_for_legacy_orders.rb