Skip to content

Instantly share code, notes, and snippets.

@jparbros
Created September 24, 2010 04:05
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 jparbros/594852 to your computer and use it in GitHub Desktop.
Save jparbros/594852 to your computer and use it in GitHub Desktop.
class Manager < User
end
class Task < ActiveRecord::Base
has_one :worker, :as => :roleable
has_one :manager, :as => :roleable
end
class User < ActiveRecord::Base
belongs_to :roleable, :polymorphic => true
end
class Worker < User
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment