elevation / event_calendar

Show multiple, overlapping events across calendar days and rows. Rails plugin.
http://dev.elevationblog.com/2009/7/23/event-calendar-rails-plugin
MIT License
948 stars 212 forks source link

Issues with mongoid #70

Open creativecommunion opened 12 years ago

creativecommunion commented 12 years ago

I originally was getting "undefined local variable or method has_event_calendar' for Event:Class" So, I added "include EventCalendar" to my event.rb Now I am getting "undefined methodexpand_complex_criteria' for #Array:0x000001055bf238"

Any ideas?

richardcalahan commented 12 years ago

Sounds like you need to restart your server?

ghost commented 12 years ago

@creativecommunion

Did you manage to make it work or did you switch to FullCalendar ?

I spent 2 days trying to make event_calendar work with mongoid and didn't manage.

I actually have the same issue that you did.

Restarting the server doesn't change anything.

creativecommunion commented 12 years ago

No. I'm still using event_calendar Try this in event.rb

def self.events_for_date_range(start_d, end_d, find_options = {})

Merging find_options until https://github.com/mongoid/mongoid/issues/829 is fixed

where(find_options.merge(self.end_at_field.to_sym.lt => end_d.to_time.utc, self.start_at_field.to_sym.gt => start_d.to_time.utc)).asc(self.start_at_field) end