This week only. Pastebin PRO Accounts Christmas Special! Don't miss out!Want more features on Pastebin? Sign Up, it's FREE!
Guest

Marcos Zanona

By: a guest on Sep 1st, 2009  |  syntax: Rails  |  size: 0.20 KB  |  views: 52  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
This paste has a previous version, view the difference. Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. class User < ActiveRecord::Base
  2.   def apps(*args)
  3.     if developer?
  4.       ActiveRecord::Base::User.has_many :apps
  5.     else
  6.       raise(NoMethodError, "Only developers get creations.")
  7.     end
  8.   end
  9. end
clone this paste RAW Paste Data