Sha256: ab4f712d0cfdbf8157bdc41b7a96e5aa49f59ea8245bbf3add13af4f445c4428
Contents?: true
Size: 592 Bytes
Versions: 4
Compression:
Stored size: 592 Bytes
Contents
require File.expand_path('../../base_controller_decorator', __FILE__) Spree::Admin::UsersController.class_eval do rescue_from Spree::User::DestroyWithOrdersError, :with => :user_destroy_with_orders_error update.after :sign_in_if_change_own_password before_filter :load_roles, :only => [:edit, :new, :update, :create] private def sign_in_if_change_own_password if spree_current_user == @user && @user.password.present? sign_in(@user, :event => :authentication, :bypass => true) end end def load_roles @roles = Spree::Role.scoped end end
Version data entries
4 entries across 4 versions & 1 rubygems