Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NoMethodError: undefined method `rule=' for nil:NilClass #25

Open
sebastiandeutsch opened this issue Sep 25, 2016 · 0 comments
Open

NoMethodError: undefined method `rule=' for nil:NilClass #25

sebastiandeutsch opened this issue Sep 25, 2016 · 0 comments

Comments

@sebastiandeutsch
Copy link

Hi,

I'm trying out your gem and I'm getting an undefined method error with the following code (leaving recurring events aside for the moment):

event = calendar.events.where(uid: ical_event.uid.to_s).first_or_create
event.summary = ical_event.summary.to_s
event.description = ical_event.description.to_s

event.schedule.rule = "singular"
event.schedule.date = ical_event.dtstart
event.schedule.until = ical_event.dtend

event.save

These are my models:

class Event < ApplicationRecord
  acts_as_schedulable :schedule
end
class Schedule < Schedulable::Model::Schedule
end

Do I have to instantiate the schedule by myself - anything else that might be wrong?

Best

Sebastian

PS: That's my environment

ruby 2.2.2
Rails 5.0.0.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant