Skip to content

Instantly share code, notes, and snippets.

@akaHeimdall
Created August 3, 2009 17:00
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 akaHeimdall/160692 to your computer and use it in GitHub Desktop.
Save akaHeimdall/160692 to your computer and use it in GitHub Desktop.
class User < ActiveRecord::Base
has_and_belongs_to_many :roles
def role_symbols
(self.roles || []).map {|r| r.name.to_sym}
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment