Hello ng,
person.rb:
class Person < ActiveRecord::Base
def initialize(mytype)
@type=mytype.to_s
end
def self.find_employee
find(:all, :conditions => “type=‘Employee’’”)
end
end
class Employee < Person
def initialize
super(‘Employee’)
end
end
class Manager < Person
def initialize
super(‘Manager’)
end
end
Okay, if I run ruby script/console
and create an instance of Employee with :
e= Employee.new
following error displayed:
uninitialized Constant Employee
if I first create a Person with:
p= Person.new(‘Bla Bla’)
and then create an instance of Employee
with e= Employee.new
why is it so???
Thanks for help
Tobias