Skip to content

Instantly share code, notes, and snippets.

@mcfiredrill
Created May 8, 2012 19: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 mcfiredrill/2638540 to your computer and use it in GitHub Desktop.
Save mcfiredrill/2638540 to your computer and use it in GitHub Desktop.
class variables
class FooJob < JobBase
@@model_name = Foo
end
class JobBase
attr_reader :model_name, :model_id, :job
def initialize(model_id)
@model_id = model_id
@job = @@model_name.find(@model_id).job
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment