# Model def Event WEEKDAYS = ['sunday', 'monday', 'wednesday', 'thursday', 'friday', 'saturday'] end # Migration create_table :events do |t| t.column recurring, default: false t.column start_date:datetime end
# Console Event.create(:name => 'Avengers', :recurring => true, :week_days => ['Sunday', 'Wednesday']) Event.create(:name => 'Dummy movie', :recurring => false) Event.today #Today events ( Dummy movie, Avengers) Event.between(tomorrow, end_of_the_month) # ( Avengers, Avengers, Avengers, ...... )
Neat, I didn't know about Recurring Select. What kind of params does the
recurring_select field send over? Their Readme doesn't really explain that.
Join 27,623+ developers who get early access to new screencasts, articles, guides, updates, and more.