Created
February 27, 2009 10:14
-
-
Save avit/71394 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
class Role < ActiveRecord::Base | |
def self.[] (key) | |
find_by_name key.to_s | |
end | |
end | |
@user.role = Role['admin'] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment