Check out the Pastebin Gadgets Shop. We have thousands of fun, geeky & affordable gadgets on sale :-)Want more features on Pastebin? Sign Up, it's FREE!

Marcos Zanona

By: a guest on Sep 1st, 2009  |  syntax: Rails  |  size: 0.20 KB  |  views: 56  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print  |  QR code  |  clone
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