Created
January 26, 2015 18:56
-
-
Save mvidaurre/53f20525dbc3199b9a33 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Spree::User.class_eval do | |
scope :distributor, -> { includes(:spree_roles).where("#{Role.table_name}.name" => "distributor") } | |
def distributor? | |
has_spree_role?('distributor') | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment