conversionfoundry / breeze

A Ruby on Rails CMS for brochure-style websites.
Other
3 stars 2 forks source link

alias_method in admin_controller prevents loading breeze_commerce #101

Closed isaacfreeman closed 11 years ago

isaacfreeman commented 11 years ago

Breeze::Admin::AdminController uses alias_method to give convenient alternative names to the Devise methods current_admin and admin_signed_in?

This breaks for sites with Breeze Commerce, because AdminController gets loaded before Devise. THe alias shouldn't be evaluated before all modules are loaded.

albandiguer commented 11 years ago

I think what is wrong is that the alias has a mistake in it.

  alias_method :current_user, :current_admin
  alias_method :signed_in?, :admin_signed_in?

was actually meant to be :

  alias_method  :current_admin, :current_user
  alias_method :admin_signed_in?, :signed_in?