How and where are you executing the code in this lib from, rake task,
script/console, etc.?

On Nov 28, 12:10 pm, Christian Lescuyer <[EMAIL PROTECTED]>
wrote:
> Hi,
>
> I'm trying to verify that a parameter is an instance of a specific
> class in Rails:
>
> def schedule(action, *args)
>   if arg.is_a? Aircraft
>     ...
>   end
> end
>
> I'm doing this in a library class (the file is in lib/) and I get an
> uninitialized constant Aircraft error. Aircraft is a model class, with
> a corresponding aircraft.rb file in app/models.
>
> Can I use model classes and instances in a library? How?
>
> Thanks,
> Xtian
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to