Skip to content

Instantly share code, notes, and snippets.

@mvidaurre
Created January 26, 2015 18:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mvidaurre/53f20525dbc3199b9a33 to your computer and use it in GitHub Desktop.
Save mvidaurre/53f20525dbc3199b9a33 to your computer and use it in GitHub Desktop.
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