Browse files

Don't rename users table to spree_users if there is a User class defined

If this were to happen, it would most-likely rename the users table for the application, and not the Spree one. The Spree table would never have been created because there would have already been a table called users.

hat-tip: @rohitnair
  • Loading branch information...
1 parent 1e95220 commit 4c8088af900077df26a325235e6610ae89702c90 @radar radar committed Jun 5, 2012
Showing with 3 additions and 1 deletion.
  1. +3 −1 core/db/migrate/20111007143030_namespace_top_level_models.rb
@@ -41,7 +41,9 @@ def change
rename_table :taxons, :spree_taxons
rename_table :taxonomies, :spree_taxonomies
rename_table :trackers, :spree_trackers
- rename_table :users, :spree_users
+ unless defined?(User)
+ rename_table :users, :spree_users
+ end
rename_table :variants, :spree_variants
rename_table :zones, :spree_zones
rename_table :zone_members, :spree_zone_members

0 comments on commit 4c8088a

Please sign in to comment.