Reputation: 81
i'm developing a calendar webapp for my company using ruby 1.8.7 and rails 2.3.8. naturally there are RoR models named "Calendar" and "Event".
in order to send calendar events to other apps (microsoft outlook & lotus notes) i'm integrating with the iCalendar standard & ruby library. http://icalendar.rubyforge.org/ but this library contains classes called "Calendar" and "Event"
now my app is getting lotta errors like this when it tries to use activerecord find - @calendar = Calendar.find(id) :
NoMethodError (undefined method find' for **Icalendar::Calendar:Class**):
app/controllers/foos_controller.rb:184:in
sendEmailDialogForm'
C:/Ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
is there some way to do:
@calendar = ActiveRecord::Base.Calendar.find(id) ??
or
@calendar = appname.Calendar.find(id)
or
@calendar = this.Calendar.find(id)
lazily trying to avoid using a module to specify a namespace or to rename my models.
Upvotes: 1
Views: 754
Reputation: 6840
I'm thinking you have an include Icalendar
somewhere. Try pulling that out & making your calls to that library using Icalendar::Calendar.new(...)
. This should take care of the namespace conflicts.
Upvotes: 2