Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save karthiks/2689276 to your computer and use it in GitHub Desktop.
Save karthiks/2689276 to your computer and use it in GitHub Desktop.
Implementation without StringInquirer
class User < ActiveRecord::Base
has_one user_profile, :dependent => :destroy
def admin?
user.user_profile.type.titleize == "Admin"
end
def exhibition_curator?
user.user_profile.type.titleize == "Exhibition Curator"
end
def estate?
user.user_profile.type.titleize == "Estate"
end
def artist?
user.user_profile.type.titleize == "Artist"
end
def collector?
user.user_profile.type.titleize == "Collector"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment