diff --git a/.mise.toml b/.mise.toml new file mode 100644 index 0000000..28bba6c --- /dev/null +++ b/.mise.toml @@ -0,0 +1,4 @@ +[tools] +ruby = "3.4.1" + + diff --git a/CHANGELOG.md b/CHANGELOG.md index f080ab6..1dd22ea 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,17 @@ master #### Enhancements * Added option `input_types` for integrating custom form controls +v1.1.0 +------ + +#### Enhancements +* Rails 7.2 compatibility updates (ActiveRecord concern load via Railtie) +* Use YAML coder for serialized attributes + +#### Maintenance +* Bump required Ruby to >= 3.0 +* Set Rails dependency to >= 7.2 + #### Bugfix * Fix max_build_count-option should be ignored when set to zero diff --git a/Gemfile b/Gemfile index df4040c..ab63869 100644 --- a/Gemfile +++ b/Gemfile @@ -13,11 +13,15 @@ gemspec # To use debugger # gem 'debugger' -gem 'ice_cube', git: 'git://github.com/joelmeyerhamme/ice_cube.git', branch: 'master' -gem 'simple_form' -gem 'rails-i18n', '~> 4.0.0' # For 4.0.x -gem "date_picker", github: 'benignware/date_picker' -gem 'database_cleaner' -gem 'sqlite3' -gem 'factory_girl_rails', "~> 4.0" -gem 'turbolinks', :git => 'git://github.com/rails/turbolinks.git' \ No newline at end of file +gem 'ice_cube' +gem 'simple_form', '~> 5.2' +gem 'rails-i18n', '~> 7.0' +gem 'turbolinks', '~> 5.2' + +group :development, :test do + gem 'sqlite3', '~> 1.6' + gem 'rspec-rails', '~> 6.0' + gem 'factory_bot_rails', '~> 6.2' + gem 'database_cleaner-active_record', '~> 2.1' + gem 'debug', platforms: [:mri, :mingw, :x64_mingw] +end \ No newline at end of file diff --git a/Gemfile.lock b/Gemfile.lock index f4d836d..07f1e2c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,162 +1,254 @@ -GIT - remote: git://github.com/benignware/date_picker.git - revision: 3c2e500021e94bb238bf48bce5d9c4f8ea49dfb0 - specs: - date_picker (0.0.9) - rails (>= 4.0.3) - -GIT - remote: git://github.com/joelmeyerhamme/ice_cube.git - revision: 22bcc01d516406501fdd4acdb51ebcab2c706a51 - branch: master - specs: - ice_cube (0.14.0) - -GIT - remote: git://github.com/rails/turbolinks.git - revision: 37a7c296232d20a61bd1946f600da7f2009189db - specs: - turbolinks (3.0.0) - coffee-rails - PATH remote: . specs: - schedulable (0.0.10) - ice_cube - rails (>= 4.0.3) + schedulable (1.1.0) + ice_cube (~> 0.17.0) + rails (>= 7.2.0) GEM remote: https://rubygems.org/ specs: - actionmailer (4.2.7.1) - actionpack (= 4.2.7.1) - actionview (= 4.2.7.1) - activejob (= 4.2.7.1) - mail (~> 2.5, >= 2.5.4) - rails-dom-testing (~> 1.0, >= 1.0.5) - actionpack (4.2.7.1) - actionview (= 4.2.7.1) - activesupport (= 4.2.7.1) - rack (~> 1.6) - rack-test (~> 0.6.2) - rails-dom-testing (~> 1.0, >= 1.0.5) - rails-html-sanitizer (~> 1.0, >= 1.0.2) - actionview (4.2.7.1) - activesupport (= 4.2.7.1) + actioncable (7.2.2.1) + actionpack (= 7.2.2.1) + activesupport (= 7.2.2.1) + nio4r (~> 2.0) + websocket-driver (>= 0.6.1) + zeitwerk (~> 2.6) + actionmailbox (7.2.2.1) + actionpack (= 7.2.2.1) + activejob (= 7.2.2.1) + activerecord (= 7.2.2.1) + activestorage (= 7.2.2.1) + activesupport (= 7.2.2.1) + mail (>= 2.8.0) + actionmailer (7.2.2.1) + actionpack (= 7.2.2.1) + actionview (= 7.2.2.1) + activejob (= 7.2.2.1) + activesupport (= 7.2.2.1) + mail (>= 2.8.0) + rails-dom-testing (~> 2.2) + actionpack (7.2.2.1) + actionview (= 7.2.2.1) + activesupport (= 7.2.2.1) + nokogiri (>= 1.8.5) + racc + rack (>= 2.2.4, < 3.2) + rack-session (>= 1.0.1) + rack-test (>= 0.6.3) + rails-dom-testing (~> 2.2) + rails-html-sanitizer (~> 1.6) + useragent (~> 0.16) + actiontext (7.2.2.1) + actionpack (= 7.2.2.1) + activerecord (= 7.2.2.1) + activestorage (= 7.2.2.1) + activesupport (= 7.2.2.1) + globalid (>= 0.6.0) + nokogiri (>= 1.8.5) + actionview (7.2.2.1) + activesupport (= 7.2.2.1) builder (~> 3.1) - erubis (~> 2.7.0) - rails-dom-testing (~> 1.0, >= 1.0.5) - rails-html-sanitizer (~> 1.0, >= 1.0.2) - activejob (4.2.7.1) - activesupport (= 4.2.7.1) - globalid (>= 0.3.0) - activemodel (4.2.7.1) - activesupport (= 4.2.7.1) - builder (~> 3.1) - activerecord (4.2.7.1) - activemodel (= 4.2.7.1) - activesupport (= 4.2.7.1) - arel (~> 6.0) - activesupport (4.2.7.1) - i18n (~> 0.7) - json (~> 1.7, >= 1.7.7) - minitest (~> 5.1) - thread_safe (~> 0.3, >= 0.3.4) - tzinfo (~> 1.1) - arel (6.0.3) + erubi (~> 1.11) + rails-dom-testing (~> 2.2) + rails-html-sanitizer (~> 1.6) + activejob (7.2.2.1) + activesupport (= 7.2.2.1) + globalid (>= 0.3.6) + activemodel (7.2.2.1) + activesupport (= 7.2.2.1) + activerecord (7.2.2.1) + activemodel (= 7.2.2.1) + activesupport (= 7.2.2.1) + timeout (>= 0.4.0) + activestorage (7.2.2.1) + actionpack (= 7.2.2.1) + activejob (= 7.2.2.1) + activerecord (= 7.2.2.1) + activesupport (= 7.2.2.1) + marcel (~> 1.0) + activesupport (7.2.2.1) + base64 + benchmark (>= 0.3) + bigdecimal + concurrent-ruby (~> 1.0, >= 1.3.1) + connection_pool (>= 2.2.5) + drb + i18n (>= 1.6, < 2) + logger (>= 1.4.2) + minitest (>= 5.1) + securerandom (>= 0.3) + tzinfo (~> 2.0, >= 2.0.5) + base64 (0.2.0) + benchmark (0.4.0) + bigdecimal (3.1.9) builder (3.2.2) - coffee-rails (4.2.1) - coffee-script (>= 2.2.0) - railties (>= 4.0.0, < 5.2.x) - coffee-script (2.4.1) - coffee-script-source - execjs - coffee-script-source (1.10.0) - concurrent-ruby (1.0.2) - database_cleaner (1.5.3) - erubis (2.7.0) - execjs (2.7.0) - factory_girl (4.7.0) - activesupport (>= 3.0.0) - factory_girl_rails (4.7.0) - factory_girl (~> 4.7.0) - railties (>= 3.0.0) - globalid (0.3.7) - activesupport (>= 4.1.0) - i18n (0.7.0) - json (1.8.3) - loofah (2.0.3) - nokogiri (>= 1.5.9) - mail (2.6.4) - mime-types (>= 1.16, < 4) - mime-types (3.1) - mime-types-data (~> 3.2015) - mime-types-data (3.2016.0521) - mini_portile2 (2.1.0) + concurrent-ruby (1.3.5) + connection_pool (2.5.3) + crass (1.0.6) + database_cleaner-active_record (2.2.1) + activerecord (>= 5.a) + database_cleaner-core (~> 2.0.0) + database_cleaner-core (2.0.1) + date (3.4.1) + debug (1.10.0) + irb (~> 1.10) + reline (>= 0.3.8) + diff-lcs (1.6.2) + drb (2.2.3) + erb (5.0.1) + erubi (1.13.1) + factory_bot (6.5.1) + activesupport (>= 6.1.0) + factory_bot_rails (6.4.4) + factory_bot (~> 6.5) + railties (>= 5.0.0) + globalid (1.2.1) + activesupport (>= 6.1) + i18n (1.14.7) + concurrent-ruby (~> 1.0) + ice_cube (0.17.0) + io-console (0.8.0) + irb (1.15.2) + pp (>= 0.6.0) + rdoc (>= 4.0.0) + reline (>= 0.4.2) + logger (1.7.0) + loofah (2.24.1) + crass (~> 1.0.2) + nokogiri (>= 1.12.0) + mail (2.8.1) + mini_mime (>= 0.1.1) + net-imap + net-pop + net-smtp + marcel (1.0.4) + mini_mime (1.1.5) + mini_portile2 (2.8.9) minitest (5.9.1) - nokogiri (1.6.8.1) - mini_portile2 (~> 2.1.0) - rack (1.6.4) + mutex_m (0.2.0) + net-imap (0.5.8) + date + net-protocol + net-pop (0.1.2) + net-protocol + net-protocol (0.2.2) + timeout + net-smtp (0.5.1) + net-protocol + nio4r (2.7.4) + nokogiri (1.18.8) + mini_portile2 (~> 2.8.2) + racc (~> 1.4) + nokogiri (1.18.8-arm64-darwin) + racc (~> 1.4) + pp (0.6.2) + prettyprint + prettyprint (0.2.0) + psych (5.2.6) + date + stringio + racc (1.8.1) + rack (3.1.15) + rack-session (2.1.1) + base64 (>= 0.1.0) + rack (>= 3.0.0) rack-test (0.6.3) rack (>= 1.0) - rails (4.2.7.1) - actionmailer (= 4.2.7.1) - actionpack (= 4.2.7.1) - actionview (= 4.2.7.1) - activejob (= 4.2.7.1) - activemodel (= 4.2.7.1) - activerecord (= 4.2.7.1) - activesupport (= 4.2.7.1) - bundler (>= 1.3.0, < 2.0) - railties (= 4.2.7.1) - sprockets-rails - rails-deprecated_sanitizer (1.0.3) - activesupport (>= 4.2.0.alpha) - rails-dom-testing (1.0.7) - activesupport (>= 4.2.0.beta, < 5.0) - nokogiri (~> 1.6.0) - rails-deprecated_sanitizer (>= 1.0.1) - rails-html-sanitizer (1.0.3) - loofah (~> 2.0) - rails-i18n (4.0.9) - i18n (~> 0.7) - railties (~> 4.0) - railties (4.2.7.1) - actionpack (= 4.2.7.1) - activesupport (= 4.2.7.1) - rake (>= 0.8.7) - thor (>= 0.18.1, < 2.0) - rake (11.3.0) - simple_form (3.3.1) - actionpack (> 4, < 5.1) - activemodel (> 4, < 5.1) - sprockets (3.7.0) + rackup (2.2.1) + rack (>= 3) + rails (7.2.2.1) + actioncable (= 7.2.2.1) + actionmailbox (= 7.2.2.1) + actionmailer (= 7.2.2.1) + actionpack (= 7.2.2.1) + actiontext (= 7.2.2.1) + actionview (= 7.2.2.1) + activejob (= 7.2.2.1) + activemodel (= 7.2.2.1) + activerecord (= 7.2.2.1) + activestorage (= 7.2.2.1) + activesupport (= 7.2.2.1) + bundler (>= 1.15.0) + railties (= 7.2.2.1) + rails-dom-testing (2.3.0) + activesupport (>= 5.0.0) + minitest + nokogiri (>= 1.6) + rails-html-sanitizer (1.6.2) + loofah (~> 2.21) + nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0) + rails-i18n (7.0.10) + i18n (>= 0.7, < 2) + railties (>= 6.0.0, < 8) + railties (7.2.2.1) + actionpack (= 7.2.2.1) + activesupport (= 7.2.2.1) + irb (~> 1.13) + rackup (>= 1.0.0) + rake (>= 12.2) + thor (~> 1.0, >= 1.2.2) + zeitwerk (~> 2.6) + rake (13.2.1) + rdoc (6.14.0) + erb + psych (>= 4.0.0) + reline (0.6.1) + io-console (~> 0.5) + rspec-core (3.13.3) + rspec-support (~> 3.13.0) + rspec-expectations (3.13.4) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.13.0) + rspec-mocks (3.13.4) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.13.0) + rspec-rails (6.1.5) + actionpack (>= 6.1) + activesupport (>= 6.1) + railties (>= 6.1) + rspec-core (~> 3.13) + rspec-expectations (~> 3.13) + rspec-mocks (~> 3.13) + rspec-support (~> 3.13) + rspec-support (3.13.3) + securerandom (0.4.1) + simple_form (5.3.1) + actionpack (>= 5.2) + activemodel (>= 5.2) + sqlite3 (1.7.3) + mini_portile2 (~> 2.8.0) + stringio (3.1.7) + thor (1.3.2) + timeout (0.4.3) + turbolinks (5.2.1) + turbolinks-source (~> 5.2) + turbolinks-source (5.2.0) + tzinfo (2.0.6) concurrent-ruby (~> 1.0) - rack (> 1, < 3) - sprockets-rails (3.2.0) - actionpack (>= 4.0) - activesupport (>= 4.0) - sprockets (>= 3.0.0) - sqlite3 (1.3.12) - thor (0.19.1) - thread_safe (0.3.5) - tzinfo (1.2.2) - thread_safe (~> 0.1) + useragent (0.16.11) + websocket-driver (0.7.7) + base64 + websocket-extensions (>= 0.1.0) + websocket-extensions (0.1.5) + zeitwerk (2.7.3) PLATFORMS + arm64-darwin-24 ruby DEPENDENCIES - database_cleaner - date_picker! - factory_girl_rails (~> 4.0) - ice_cube! - rails-i18n (~> 4.0.0) + database_cleaner-active_record (~> 2.1) + debug + factory_bot_rails (~> 6.2) + ice_cube + mutex_m (~> 0.2.0) + rails-i18n (~> 7.0) + rspec-rails (~> 6.0) schedulable! - simple_form - sqlite3 - turbolinks! + simple_form (~> 5.2) + sqlite3 (~> 1.6) + turbolinks (~> 5.2) BUNDLED WITH - 1.13.6 + 2.6.9 diff --git a/README.md b/README.md index 4edbecf..929957b 100644 --- a/README.md +++ b/README.md @@ -407,3 +407,8 @@ end ## Changelog See the [Changelog](CHANGELOG.md) for recent enhancements, bugfixes and deprecations. + +## Compatibility + +- Rails >= 7.2 +- Ruby >= 3.0 (tested on 3.4.1) diff --git a/lib/generators/schedulable/templates/inputs/schedule_input.rb b/lib/generators/schedulable/templates/inputs/schedule_input.rb index cde0e57..2a34e62 100644 --- a/lib/generators/schedulable/templates/inputs/schedule_input.rb +++ b/lib/generators/schedulable/templates/inputs/schedule_input.rb @@ -1,46 +1,46 @@ class ScheduleInput < SimpleForm::Inputs::Base - + def input(wrapper_options) - + # Init options input_options||= {} - + # I18n weekdays = Date::DAYNAMES.map(&:downcase) weekdays = weekdays.slice(1..7) << weekdays.slice(0) - + day_names = I18n.t('date.day_names', default: "") day_names = day_names.blank? ? weekdays.map { |day| day.capitalize } : day_names.slice(1..7) << day_names.slice(0) day_labels = Hash[weekdays.zip(day_names)] - + # Pass in default month names when missing in translations month_names = I18n.t('date.month_names', default: "") month_names = month_names.blank? ? Date::MONTHNAMES : month_names # Pass in default order when missing in translations date_order = I18n.t('date.order', default: "") - date_order = date_order.blank? ? [:year, :month, :day] : date_order - + date_order = date_order.blank? ? [:year, :month, :day] : date_order + # Setup date_options date_options = { order: date_order, use_month_names: month_names } - + # Input html options input_html_options[:type] ||= input_type if html5? - + # Get config options config_options = Schedulable.config.simple_form.present? ? Schedulable.config.simple_form : {} - + # Merge input options input_options = config_options.merge(input_options) - + # Input options input_options[:interval] = !input_options[:interval].nil? ? input_options[:interval] : false input_options[:until] = !input_options[:until].nil? ? input_options[:until] : false input_options[:count] = !input_options[:count].nil? ? input_options[:count] : false - + # Setup input types input_types = {date: :date, time: :time, datetime: :datetime}.merge(input_options[:input_types] || {}) @@ -48,49 +48,53 @@ def input(wrapper_options) # Javascript element id field_id = b.object_name.to_s.gsub(/\]\[|[^-a-zA-Z0-9:.]/,"_").sub(/_$/,"") - + b.template.content_tag("div", {id: field_id}) do - - b.input(:rule, collection: ['singular', 'daily', 'weekly', 'monthly'], label_method: lambda { |v| I18n.t("schedulable.rules.#{v}", default: v.capitalize) }, label: false, include_blank: false) << - + + b.input(:rule, collection: ['singular', 'daily', 'weekly', 'monthly'], label_method: lambda { |v| I18n.t("schedulable.rules.#{v}", default: v.capitalize) }, label: false, include_blank: false) << + template.content_tag("div", {data: {group: 'singular'}}) do b.input :date, date_options.merge({as: input_types[:date]}) end << - + template.content_tag("div", {data: {group: 'weekly'}}) do b.input :day, collection: weekdays, label_method: lambda { |v| (" " + day_labels[v]).html_safe}, boolean_style: :nested, as: :check_boxes end << - + template.content_tag("div", {data: {group: 'monthly'}}) do - + b.simple_fields_for :day_of_week, OpenStruct.new(b.object.day_of_week || {}) do |db| template.content_tag("div", class: 'form-group' + (b.object.errors[:day_of_week].any? ? " has-error" : "")) do - b.label(:day_of_week, error: true) << + b.label(:day_of_week, error: true) << template.content_tag("div", nil, style: 'min-width: 280px; display: table') do template.content_tag("div", nil, style: 'display: table-row') do template.content_tag("span", nil, style: 'display: table-cell;') << - ['1st', '2nd', '3rd', '4th', 'last'].reduce(''.html_safe) { | content, item | + ['1st', '2nd', '3rd', '4th', 'last'].reduce(''.html_safe) { | content, item | content << template.content_tag("span", I18n.t("schedulable.monthly_week_names.#{item}", default: item.to_s), style: 'display: table-cell; text-align: center') } end << - weekdays.reduce(''.html_safe) do | content, weekday | - content << template.content_tag("div", nil, style: 'display: table-row') do + weekdays.reduce(''.html_safe) do | content, weekday | + content << template.content_tag("div", nil, style: 'display: table-row') do template.content_tag("span", day_labels[weekday] || weekday, style: 'display: table-cell') << db.collection_check_boxes(weekday.to_sym, [1, 2, 3, 4, -1], lambda { |i| i} , lambda { |i| " ".html_safe}, boolean_style: :inline, label: false, checked: db.object.send(weekday), inline_label: false, item_wrapper_tag: nil) do |cb| template.content_tag("span", style: 'display: table-cell; text-align: center;') { cb.check_box(class: "check_box") } - end + end end end - end << + end << b.error(:day_of_week) end end - end << - + end << + template.content_tag("div", data: {group: 'singular,daily,weekly,monthly'}) do b.input :time, date_options.merge({as: input_types[:time]}) - end << - + end << + + template.content_tag("div", data: {group: 'singular,daily,weekly,monthly'}) do + b.input :time_end, date_options.merge({as: input_types[:time]}) + end << + (if input_options[:interval] template.content_tag("div", data: {group: 'daily,weekly,monthly'}) do b.input :interval @@ -98,7 +102,7 @@ def input(wrapper_options) else b.input(:interval, as: :hidden, input_html: {value: 1}) end) << - + (if input_options[:until] template.content_tag("div", data: {group: 'daily,weekly,monthly'}) do b.input :until, date_options.merge({as: input_types[:datetime]}) @@ -106,7 +110,7 @@ def input(wrapper_options) else b.input(:until, as: :hidden, input_html: {value: nil}) end) << - + if input_options[:count] template.content_tag("div", data: {group: 'daily,weekly,monthly'}) do b.input :count @@ -114,33 +118,33 @@ def input(wrapper_options) else b.input(:count, as: :hidden, input_html: {value: 0}) end - - - + + + end << - + template.javascript_tag( - "(function() {" << - " var container = document.querySelectorAll('##{field_id}'); container = container[container.length - 1]; " << - " var select = container.querySelector(\"select[name*='rule']\"); " << + "(function() {" << + " var container = document.querySelectorAll('##{field_id}'); container = container[container.length - 1]; " << + " var select = container.querySelector(\"select[name*='rule']\"); " << " function update() {" << - " var value = this.value;" << + " var value = this.value;" << " [].slice.call(container.querySelectorAll(\"*[data-group]\")).forEach(function(elem) { " << " var groups = elem.getAttribute('data-group').split(',');" << " if (groups.indexOf(value) >= 0) {" << - " elem.style.display = ''" << + " elem.style.display = ''" << " } else {" << - " elem.style.display = 'none'" << + " elem.style.display = 'none'" << " }" << " });" << - " }" << + " }" << " if (jQuery) { jQuery(select).on('change', update); } else { select.addEventListener('change', update); }" << - " update.call(select);" << + " update.call(select);" << "})()" ) - + end - - + + end -end \ No newline at end of file +end diff --git a/lib/generators/schedulable/templates/migrations/create_schedules.rb b/lib/generators/schedulable/templates/migrations/create_schedules.rb index ace96d1..164cd9c 100644 --- a/lib/generators/schedulable/templates/migrations/create_schedules.rb +++ b/lib/generators/schedulable/templates/migrations/create_schedules.rb @@ -2,19 +2,20 @@ class CreateSchedules < ActiveRecord::Migration def self.up create_table :schedules do |t| t.references :schedulable, polymorphic: true - + t.date :date t.time :time - + t.time :time_end + t.string :rule t.string :interval - + t.text :day t.text :day_of_week - + t.datetime :until t.integer :count - + t.timestamps end end @@ -22,4 +23,4 @@ def self.up def self.down drop_table :schedules end -end \ No newline at end of file +end diff --git a/lib/locales/en.yml b/lib/locales/en.yml index 0bb9786..6cb4c68 100644 --- a/lib/locales/en.yml +++ b/lib/locales/en.yml @@ -1,29 +1,30 @@ en: model: schedule: 'Schedule' - + activerecord: attributes: schedule: name: Name rule: Regel time: Time + time_end: Time End date: Date rule: Rule day: Weekdays day_of_week: Weekdays of nth week until: Repeat until count: Repetition count - - schedulable: + + schedulable: monthly_week_names: 1st: '1st' 2nd: '2nd' 3rd: '3rd' 4th: '4th' last: 'Last' - rules: + rules: singular: Singular monthly: Monthly weekly: Weekly - daily: Daily \ No newline at end of file + daily: Daily diff --git a/lib/schedulable.rb b/lib/schedulable.rb index ef21df7..dab3a11 100644 --- a/lib/schedulable.rb +++ b/lib/schedulable.rb @@ -5,6 +5,7 @@ require 'schedulable/schedule_support' require 'schedulable/form_helper' require 'i18n' +require 'yaml' module Schedulable diff --git a/lib/schedulable/acts_as_schedulable.rb b/lib/schedulable/acts_as_schedulable.rb index 5cd12a5..312973b 100644 --- a/lib/schedulable/acts_as_schedulable.rb +++ b/lib/schedulable/acts_as_schedulable.rb @@ -9,78 +9,79 @@ module ActsAsSchedulable module ClassMethods - def acts_as_schedulable(name, options = {}) + def acts_as_schedulable(name = :schedule, *args, **kwargs) + name = name.to_sym + options = {} + options = args.last if args.last.is_a?(Hash) + options = options.merge(kwargs) if kwargs.any? - name||= :schedule - attribute = :date - - has_one name, as: :schedulable, dependent: :destroy, class_name: 'Schedule' + has_one name, + -> { where(schedulable_type: base_class.name) }, + as: :schedulable, + dependent: :destroy, + class_name: 'Schedulable::Model::Schedule' accepts_nested_attributes_for name if options[:occurrences] # setup association - if options[:occurrences].is_a?(String) || options[:occurrences].is_a?(Symbol) - occurrences_association = options[:occurrences].to_sym - options[:occurrences] = {} + occurrences_association = if options[:occurrences].is_a?(String) || options[:occurrences].is_a?(Symbol) + options[:occurrences].to_sym else - occurrences_association = options[:occurrences][:name] - options[:occurrences].delete(:name) + options[:occurrences][:name] end - options[:occurrences][:class_name] = occurrences_association.to_s.classify - options[:occurrences][:as]||= :schedulable - options[:occurrences][:dependent]||:destroy - options[:occurrences][:autosave]||= true - has_many occurrences_association, options[:occurrences] + occurrences_options = options[:occurrences].is_a?(Hash) ? options[:occurrences].except(:name) : {} + occurrences_options[:class_name] = occurrences_association.to_s.classify + occurrences_options[:as] ||= :schedulable + occurrences_options[:dependent] ||= :destroy + occurrences_options[:autosave] ||= true + + has_many occurrences_association, + -> { where(schedulable_type: base_class.name) }, + **occurrences_options # table_name occurrences_table_name = occurrences_association.to_s.tableize # remaining - remaining_occurrences_options = options[:occurrences].clone + remaining_occurrences_options = occurrences_options.clone remaining_occurrences_association = ("remaining_" << occurrences_association.to_s).to_sym - has_many remaining_occurrences_association, -> { where("#{occurrences_table_name}.date >= ?", Time.now).order('date ASC') }, remaining_occurrences_options + has_many remaining_occurrences_association, + -> { where("#{occurrences_table_name}.date >= ? AND schedulable_type = ?", Time.current, base_class.name).order('date ASC') }, + **remaining_occurrences_options # previous - previous_occurrences_options = options[:occurrences].clone + previous_occurrences_options = occurrences_options.clone previous_occurrences_association = ("previous_" << occurrences_association.to_s).to_sym - has_many previous_occurrences_association, -> { where("#{occurrences_table_name}.date < ?", Time.now).order('date DESC')}, previous_occurrences_options + has_many previous_occurrences_association, + -> { where("#{occurrences_table_name}.date < ? AND schedulable_type = ?", Time.current, base_class.name).order('date DESC')}, + **previous_occurrences_options ActsAsSchedulable.add_occurrences_association(self, occurrences_association) - after_save "build_#{occurrences_association}" + after_save :"build_#{occurrences_association}" - self.class.instance_eval do - define_method("build_#{occurrences_association}") do - # build occurrences for all events - # TODO: only invalid events - schedulables = self.all - schedulables.each do |schedulable| - schedulable.send("build_#{occurrences_association}") - end + singleton_class.define_method("build_#{occurrences_association}") do + # build occurrences for all events + schedulables = all + schedulables.each do |schedulable| + schedulable.send("build_#{occurrences_association}") end end define_method "build_#{occurrences_association}_after_update" do - schedule = self.send(name) - if schedule.changes.any? - self.send("build_#{occurrences_association}") + schedule = send(name) + if schedule.saved_changes.any? + send("build_#{occurrences_association}") end end define_method "build_#{occurrences_association}" do - - # build occurrences for events - - schedule = self.send(name) + schedule = send(name) if schedule.present? - - now = Time.now - - # TODO: Make configurable - occurrence_attribute = :date + now = Time.current schedulable = schedule.schedulable terminating = schedule.rule != 'singular' && (schedule.until.present? || schedule.count.present? && schedule.count > 1) @@ -88,98 +89,87 @@ def acts_as_schedulable(name, options = {}) max_period = Schedulable.config.max_build_period || 1.year max_date = now + max_period - max_date = terminating ? [max_date, schedule.last.to_time].min : max_date + if terminating && schedule.last.respond_to?(:to_time) + max_date = [max_date, schedule.last.to_time].min + end max_count = Schedulable.config.max_build_count || 100 max_count = terminating && schedule.remaining_occurrences.any? ? [max_count, schedule.remaining_occurrences.count].min : max_count - if schedule.rule != 'singular' + occurrences = if schedule.rule != 'singular' # Get schedule occurrences - all_occurrences = schedule.occurrences_between(Time.now, max_date.to_time) - occurrences = [] + all_occurrences = schedule.occurrences_between(Time.current, max_date.to_time) # Filter valid dates - all_occurrences.each_with_index do |occurrence_date, index| - if occurrence_date.present? && occurrence_date.to_time > now - if occurrence_date.to_time < max_date && (index <= max_count || max_count <= 0) - occurrences << occurrence_date - else - max_date = [max_date, occurrence_date].min - end - end + all_occurrences.select.with_index do |occurrence_date, index| + occurrence_date.present? && + occurrence_date.to_time > now && + occurrence_date.to_time < max_date && + (index <= max_count || max_count <= 0) end else # Get Singular occurrence d = schedule.date t = schedule.time - dt = d + t.seconds_since_midnight.seconds - singular_date_time = (d + t.seconds_since_midnight.seconds).to_datetime - occurrences = [singular_date_time] + [(d + t.seconds_since_midnight.seconds).to_datetime] end # Build occurrences update_mode = Schedulable.config.update_mode || :datetime # Always use index as base for singular events - if schedule.rule == 'singular' - update_mode = :index - end + update_mode = :index if schedule.rule == 'singular' # Get existing remaining records occurrences_records = schedulable.send("remaining_#{occurrences_association}") # build occurrences - existing_record = nil occurrences.each_with_index do |occurrence, index| - - # Pull an existing record - if update_mode == :index - existing_records = [occurrences_records[index]] - elsif update_mode == :datetime - existing_records = occurrences_records.select { |record| - record.date.to_datetime == occurrence.to_datetime - } + # Pull existing records + existing_records = case update_mode + when :index + [occurrences_records[index]] + when :datetime + occurrences_records.select { |record| record.date.to_datetime == occurrence.to_datetime } else - existing_records = [] + [] end if existing_records.any? - # Overwrite existing records + # Update existing records existing_records.each do |existing_record| - if !occurrences_records.update(existing_record.id, date: occurrence.to_datetime) - puts 'An error occurred while saving an existing occurrence record' + unless existing_record.update(date: occurrence.to_datetime) + Rails.logger.error('An error occurred while saving an existing occurrence record') end end else # Create new record - if !occurrences_records.create(date: occurrence.to_datetime) - puts 'An error occurred while creating an occurrence record' + unless occurrences_records.create(date: occurrence.to_datetime) + Rails.logger.error('An error occurred while creating an occurrence record') end end end - # Clean up unused remaining occurrences - occurrences_records = schedulable.send("remaining_#{occurrences_association}") - record_count = 0 - occurrences_records.each do |occurrence_record| + occurrences_records.reload.each.with_index do |occurrence_record, index| if occurrence_record.date > now # Destroy occurrence if date or count lies beyond range - if schedule.rule != 'singular' && (!schedule.occurs_on?(occurrence_record.date.to_date) || !schedule.occurring_at?(occurrence_record.date.to_time) || occurrence_record.date > max_date) || schedule.rule == 'singular' && record_count > 0 - occurrences_records.destroy(occurrence_record) + if schedule.rule != 'singular' && + (!schedule.occurs_on?(occurrence_record.date.to_date) || + !schedule.occurring_at?(occurrence_record.date.to_time) || + occurrence_record.date > max_date) || + (schedule.rule == 'singular' && index > 0) + occurrence_record.destroy end - record_count = record_count + 1 end end - end end end end - end def self.occurrences_associations_for(clazz) - @@schedulable_occurrences||= [] + @@schedulable_occurrences ||= [] @@schedulable_occurrences.select { |item| item[:class] == clazz }.map { |item| @@ -190,11 +180,9 @@ def self.occurrences_associations_for(clazz) private def self.add_occurrences_association(clazz, name) - @@schedulable_occurrences||= [] + @@schedulable_occurrences ||= [] @@schedulable_occurrences << {class: clazz, name: name} end - - end -end -ActiveRecord::Base.send :include, Schedulable::ActsAsSchedulable +end + diff --git a/lib/schedulable/form_helper.rb b/lib/schedulable/form_helper.rb index a97f615..ec0b770 100644 --- a/lib/schedulable/form_helper.rb +++ b/lib/schedulable/form_helper.rb @@ -1,6 +1,6 @@ module Schedulable module FormHelper - + STYLES = { default: { field_html: {class: 'field'}, @@ -15,15 +15,15 @@ module FormHelper collection_check_boxes_item_wrapper: {tag: 'span', class: 'checkbox'} } } - + def self.included(base) ActionView::Helpers::FormBuilder.instance_eval do include FormBuilderMethods end end - + module FormBuilderMethods - + def schedule_select(attribute, input_options = {}) template = @template @@ -31,11 +31,11 @@ def schedule_select(attribute, input_options = {}) # I18n weekdays = Date::DAYNAMES.map(&:downcase) weekdays = weekdays.slice(1..7) << weekdays.slice(0) - + day_names = I18n.t('date.day_names', default: "") day_names = day_names.blank? ? weekdays.map { |day| day.capitalize } : day_names.slice(1..7) << day_names.slice(0) day_labels = Hash[weekdays.zip(day_names)] - + # Pass in default month names when missing in translations month_names = I18n.t('date.month_names', default: "") month_names = month_names.blank? ? Date::MONTHNAMES : month_names @@ -45,22 +45,22 @@ def schedule_select(attribute, input_options = {}) date_order = date_order.map { |order| order.to_sym } - + # Setup date_options date_options = { order: date_order, use_month_names: month_names } - + # Get config options config_options = Schedulable.config.form_helper.present? ? Schedulable.config.form_helper : {style: :default} - + # Merge input options input_options = config_options.merge(input_options) - + # Setup input types input_types = {date: :date_select, time: :time_select, datetime: :datetime_select}.merge(input_options[:input_types] || {}) - + # Setup style option if input_options[:style].is_a?(Symbol) || input_options[:style].is_a?(String) style_options = STYLES.has_key?(input_options[:style]) ? STYLES[input_options[:style]] : STYLES[:default] @@ -69,66 +69,66 @@ def schedule_select(attribute, input_options = {}) else style_options = STYLES[:default] end - + # Merge with input options style_options = style_options.merge(input_options) - + # Init style properties style_options[:field_html]||= {} - + style_options[:label_html]||= {} style_options[:label_wrapper]||= {} - + style_options[:input_html]||= {} style_options[:input_wrapper]||= {} - + style_options[:number_field_html]||= {} style_options[:number_field_wrapper]||= {} - + style_options[:date_select_html]||= {} style_options[:date_select_wrapper]||= {} - + style_options[:collection_select_html]||= {} style_options[:collection_select_wrapper]||= {} - + style_options[:collection_check_boxes_item_html]||= {} style_options[:collection_check_boxes_item_wrapper]||= {} - + # Merge with default input selector style_options[:number_field_html] = style_options[:input_html].merge(style_options[:number_field_html]) style_options[:number_field_wrapper] = style_options[:input_wrapper].merge(style_options[:number_field_wrapper]) - + style_options[:date_select_html] = style_options[:input_html].merge(style_options[:date_select_html]) style_options[:date_select_wrapper] = style_options[:input_wrapper].merge(style_options[:date_select_wrapper]) - + style_options[:collection_select_html] = style_options[:input_html].merge(style_options[:collection_select_html]) style_options[:collection_select_wrapper] = style_options[:input_wrapper].merge(style_options[:collection_select_wrapper]) - + style_options[:collection_check_boxes_item_html] = style_options[:input_html].merge(style_options[:collection_check_boxes_item_html]) style_options[:collection_check_boxes_item_wrapper] = style_options[:input_wrapper].merge(style_options[:collection_check_boxes_item_wrapper]) - + # Here comes the logic... - + # Javascript element id field_id = @object_name.to_s.gsub(/\]\[|[^-a-zA-Z0-9:.]/,"_").sub(/_$/,"") + "_" + attribute.to_s @template.content_tag("div", {id: field_id}) do - + self.fields_for(attribute, @object.send(attribute.to_s) || @object.send("build_" + attribute.to_s)) do |f| - + # Rule Select @template.content_tag("div", style_options[:field_html]) do select_output = f.collection_select(:rule, ['singular', 'daily', 'weekly', 'monthly'], lambda { |v| return v}, lambda { |v| I18n.t("schedulable.rules.#{v}", default: v.capitalize) }, {include_blank: false}, style_options[:collection_select_html]) content_wrap(@template, select_output, style_options[:collection_select_wrapper]) end << - - + + # Date Select @template.content_tag("div", style_options[:field_html].merge({data: {group: 'singular'}})) do content_wrap(@template, f.label(:date, style_options[:label_html]), style_options[:label_wrapper]) << content_wrap(@template, f.send(input_types[:date].to_sym, *[:date].concat(f.method(input_types[:date].to_sym).parameters.count >= 3 ? [date_options] : []).concat([style_options[:date_select_html].clone])), style_options[:date_select_wrapper]) - end << - + end << + # Weekly Checkboxes @template.content_tag("div", style_options[:field_html].merge({data: {group: 'weekly'}})) do content_wrap(@template, f.label(:day), style_options[:label_wrapper]) << @@ -140,8 +140,8 @@ def schedule_select(attribute, input_options = {}) end content_wrap(@template, nested_output, style_options[:collection_check_boxes_item_wrapper]) end - end << - + end << + # Monthly Checkboxes @template.content_tag("div", style_options[:field_html].merge({data: {group: 'monthly'}})) do f.fields_for :day_of_week, OpenStruct.new(f.object.day_of_week || {}) do |db| @@ -149,33 +149,39 @@ def schedule_select(attribute, input_options = {}) @template.content_tag("div", nil, style: 'min-width: 280px; display: table') do @template.content_tag("div", nil, style: 'display: table-row') do @template.content_tag("span", nil, style: 'display: table-cell;') << - ['1st', '2nd', '3rd', '4th', 'last'].reduce(''.html_safe) { | content, item | + ['1st', '2nd', '3rd', '4th', 'last'].reduce(''.html_safe) { | content, item | content << @template.content_tag("span", I18n.t("schedulable.monthly_week_names.#{item}", default: item.to_s), style: 'display: table-cell; text-align: center') } end << - weekdays.reduce(''.html_safe) do | content, weekday | - content << @template.content_tag("div", nil, style: 'display: table-row') do + weekdays.reduce(''.html_safe) do | content, weekday | + content << @template.content_tag("div", nil, style: 'display: table-row') do @template.content_tag("span", day_labels[weekday] || weekday, style: 'display: table-cell') << db.collection_check_boxes(weekday.to_sym, [1, 2, 3, 4, -1], lambda { |i| i} , lambda { |i| " ".html_safe}, checked: db.object.send(weekday)) do |cb| @template.content_tag("span", style: 'display: table-cell; text-align: center') { cb.check_box() } - end + end end end end end end << - + # Time Select @template.content_tag("div", style_options[:field_html].merge({data: {group: 'singular,daily,weekly,monthly'}})) do content_wrap(@template, f.label(:time, style_options[:label_html]), style_options[:label_wrapper]) << content_wrap(@template, f.send(input_types[:time].to_sym, *[:time].concat(f.method(input_types[:time].to_sym).parameters.count >= 3 ? [date_options] : []).concat([style_options[:date_select_html].clone])), style_options[:date_select_wrapper]) end << - + + # Time End Select + @template.content_tag("div", style_options[:field_html].merge({data: {group: 'singular,daily,weekly,monthly'}})) do + content_wrap(@template, f.label(:time_end, style_options[:label_html]), style_options[:label_wrapper]) << + content_wrap(@template, f.send(input_types[:time].to_sym, *[:time_end].concat(f.method(input_types[:time].to_sym).parameters.count >= 3 ? [date_options] : []).concat([style_options[:date_select_html].clone])), style_options[:date_select_wrapper]) + end << + # Optional Fields... - + # Interval Number Field (if input_options[:interval] - + @template.content_tag("div", style_options[:field_html].merge({data: {group: 'daily,weekly,monthly'}})) do content_wrap(@template, f.label(:interval, style_options[:label_html]), style_options[:label_wrapper]) << content_wrap(@template, f.number_field(:interval, style_options[:number_field_html]), style_options[:number_field_wrapper]) @@ -183,10 +189,10 @@ def schedule_select(attribute, input_options = {}) else f.hidden_field(:interval, value: 1) end) << - + # Until Date Time Select (if input_options[:until] - + @template.content_tag("div", style_options[:field_html].merge({data: {group: 'daily,weekly,monthly'}})) do content_wrap(@template, f.label(:until, style_options[:label_html]), style_options[:label_wrapper]) << content_wrap(@template, f.send(input_types[:datetime].to_sym, *[:until].concat(f.method(input_types[:datetime].to_sym).parameters.count >= 3 ? [date_options] : []).concat([style_options[:date_select_html].clone])), style_options[:date_select_wrapper]) @@ -194,7 +200,7 @@ def schedule_select(attribute, input_options = {}) else f.hidden_field(:until, value: nil) end) << - + # Count Number Field if input_options[:count] @template.content_tag("div", style_options[:field_html].merge({data: {group: 'daily,weekly,monthly'}})) do @@ -204,46 +210,46 @@ def schedule_select(attribute, input_options = {}) else f.hidden_field(:count, value: 0) end - + end - + end << - + # Javascript template.javascript_tag( - "(function() {" << - " var container = document.querySelectorAll('##{field_id}'); container = container[container.length - 1]; " << - " var select = container.querySelector(\"select[name*='rule']\"); " << + "(function() {" << + " var container = document.querySelectorAll('##{field_id}'); container = container[container.length - 1]; " << + " var select = container.querySelector(\"select[name*='rule']\"); " << " function update() {" << - " var value = this.value;" << + " var value = this.value;" << " [].slice.call(container.querySelectorAll(\"*[data-group]\")).forEach(function(elem) { " << " var groups = elem.getAttribute('data-group').split(',');" << " if (groups.indexOf(value) >= 0) {" << - " elem.style.display = ''" << + " elem.style.display = ''" << " } else {" << - " elem.style.display = 'none'" << + " elem.style.display = 'none'" << " }" << " });" << - " }" << + " }" << " if (typeof jQuery !== 'undefined') { jQuery(select).on('change', update); } else { select.addEventListener('change', update); }" << - " update.call(select);" << + " update.call(select);" << "})()" ) - + end - - - private + + + private def content_wrap(template, content, options = nil) if options.present? && options.has_key?(:tag) template.content_tag(options[:tag], content, options.except(:tag)) else content - end + end end - + end - - + + end -end \ No newline at end of file +end diff --git a/lib/schedulable/railtie.rb b/lib/schedulable/railtie.rb index 493c9e8..786faf9 100644 --- a/lib/schedulable/railtie.rb +++ b/lib/schedulable/railtie.rb @@ -5,8 +5,8 @@ class Railtie < ::Rails::Railtie railtie_name :schedulable - # requires all dependencies - Gem.loaded_specs['schedulable'].dependencies.each do |d| + # requires only runtime dependencies + Gem.loaded_specs['schedulable'].runtime_dependencies.each do |d| require d.name end @@ -30,6 +30,13 @@ class Railtie < ::Rails::Railtie include Schedulable::FormHelper end end + + # Ensure ActiveRecord is loaded before including our concern + initializer "schedulable.active_record" do + ActiveSupport.on_load :active_record do + ActiveRecord::Base.include Schedulable::ActsAsSchedulable + end + end initializer "schedulable.locales" do diff --git a/lib/schedulable/schedule.rb b/lib/schedulable/schedule.rb index 697b70a..4956f0e 100644 --- a/lib/schedulable/schedule.rb +++ b/lib/schedulable/schedule.rb @@ -1,125 +1,133 @@ module Schedulable module Model - class Schedule < ActiveRecord::Base + class Schedule < ActiveRecord::Base + self.table_name = 'schedules' - serialize :day - serialize :day_of_week, Hash + # Use Rails 7.2+ serialization + serialize :day, coder: YAML + serialize :day_of_week, coder: YAML belongs_to :schedulable, polymorphic: true - after_initialize :update_schedule + after_initialize :set_defaults, :update_schedule before_save :update_schedule - validates_presence_of :rule - validates_presence_of :time - validates_presence_of :date, if: Proc.new { |schedule| schedule.rule == 'singular' } - validate :validate_day, if: Proc.new { |schedule| schedule.rule == 'weekly' } - validate :validate_day_of_week, if: Proc.new { |schedule| schedule.rule == 'monthly' } + validates :rule, presence: true + validates :time, presence: true + validates :date, presence: true, if: -> { rule == 'singular' } + validate :validate_day, if: -> { rule == 'weekly' } + validate :validate_day_of_week, if: -> { rule == 'monthly' } + + delegate_missing_to :@schedule, allow_nil: true + + # Normalize AR time values to core Time for compatibility with existing tests + def time + value = super() + return value if value.is_a?(Time) || value.nil? + # ActiveRecord maps time columns to ActiveSupport::TimeWithZone + if value.respond_to?(:in_time_zone) + t = value.in_time_zone + return Time.local(t.year, t.month, t.day, t.hour, t.min, t.sec) + end + value + end def to_icecube - return @schedule + @schedule end def to_s - message = "" - if self.rule == 'singular' + if rule == 'singular' # Return formatted datetime for singular rules - datetime = DateTime.new(date.year, date.month, date.day, time.hour, time.min, time.sec, time.zone) - message = I18n.localize(datetime) + datetime = date.to_datetime + time.seconds_since_midnight.seconds + I18n.localize(datetime, format: :long) else - # For other rules, refer to icecube - begin - message = @schedule.to_s - rescue Exception - locale = I18n.locale - I18n.locale = :en - message = @schedule.to_s - I18n.locale = locale - end - end - return message - end - - def method_missing(meth, *args, &block) - if @schedule.present? && @schedule.respond_to?(meth) - @schedule.send(meth, *args, &block) + # Return formatted schedule for recurring rules + to_icecube.to_s end end def self.param_names - [:id, :date, :time, :rule, :until, :count, :interval, day: [], day_of_week: [monday: [], tuesday: [], wednesday: [], thursday: [], friday: [], saturday: [], sunday: []]] + [ + :id, :date, :time, :time_end, :rule, :until, :count, :interval, + { day: [], day_of_week: { + monday: [], tuesday: [], wednesday: [], + thursday: [], friday: [], saturday: [], sunday: [] + }} + ] end - def update_schedule() - - self.rule||= "singular" - self.interval||= 1 - self.count||= 0 - - time = Date.today.to_time(:utc) - if self.time.present? - time = time + self.time.seconds_since_midnight.seconds - end - time_string = time.strftime("%d-%m-%Y %I:%M %p") - time = Time.zone.parse(time_string) - - @schedule = IceCube::Schedule.new(time) - - if self.rule && self.rule != 'singular' - - self.interval = self.interval.present? ? self.interval.to_i : 1 - - rule = IceCube::Rule.send("#{self.rule}", self.interval) - - if self.until - rule.until(self.until) - end + private - if self.count && self.count.to_i > 0 - rule.count(self.count.to_i) + def update_schedule + # Build ice_cube schedule for singular rules when date and time exist, + # and for recurring rules when at least time exists (use today's date as base) + if rule && time && (date.present? || rule != 'singular') + # Get schedule-object + base_date = (date || Date.current) + base_time = if defined?(Time.zone) && Time.zone + Time.zone.local(base_date.year, base_date.month, base_date.day, time.hour, time.min, time.sec) + else + Time.local(base_date.year, base_date.month, base_date.day, time.hour, time.min, time.sec) end - - if self.day - days = self.day.reject(&:empty?) - if self.rule == 'weekly' - days.each do |day| - rule.day(day.to_sym) + @schedule = IceCube::Schedule.new(base_time) + + case rule + when 'singular' + # No recurrence rule + when 'weekly' + days = day.map(&:to_sym) if day + recurrence_interval = (interval.presence || 1).to_i + rule = IceCube::Rule.weekly(recurrence_interval) + rule = rule.day(*days) if days + if self.until.present? + rule = rule.until(self.until.to_time) + elsif count.present? + rule = rule.count(count.to_i) + end + @schedule.add_recurrence_rule(rule) + when 'monthly' + # Expect a hash like { monday: [1,3], wednesday: [2,4] } + if day_of_week.present? + recurrence_interval = (interval.presence || 1).to_i + weekday_map = day_of_week.each_with_object({}) do |(weekday, week_numbers), acc| + acc[weekday.to_sym] = Array(week_numbers).map(&:to_i) end - elsif self.rule == 'monthly' - days = {} - day_of_week.each do |weekday, value| - days[weekday.to_sym] = value.reject(&:empty?).map { |x| x.to_i } + rule = IceCube::Rule.monthly(recurrence_interval).day_of_week(weekday_map) + if self.until.present? + rule = rule.until(self.until.to_time) + elsif count.present? + rule = rule.count(count.to_i) end - rule.day_of_week(days) + @schedule.add_recurrence_rule(rule) end end - @schedule.add_recurrence_rule(rule) - end + # Add exception for the seed datetime only when an explicit date is provided + if rule != 'singular' && date.present? + @schedule.add_exception_time(date.to_datetime + time.seconds_since_midnight.seconds) + end + end end - private + def set_defaults + # Ensure sensible default for interval on recurring rules + if rule.present? && rule != 'singular' + self.interval = 1 if interval.blank? + end + end def validate_day - day.reject! { |c| c.empty? } - if !day.any? + if rule == 'weekly' && day.empty? errors.add(:day, :empty) end end def validate_day_of_week - any = false - day_of_week.each { |key, value| - value.reject! { |c| c.empty? } - if value.length > 0 - any = true - break - end - } - if !any + if rule == 'monthly' && day_of_week.empty? errors.add(:day_of_week, :empty) end end end end -end \ No newline at end of file +end diff --git a/lib/schedulable/schedule_support.rb b/lib/schedulable/schedule_support.rb index 08a9b33..01da58b 100644 --- a/lib/schedulable/schedule_support.rb +++ b/lib/schedulable/schedule_support.rb @@ -1,10 +1,10 @@ module Schedulable - + module ScheduleSupport - + def self.param_names - [:id, :date, :time, :rule, :until, :count, :interval, day: [], day_of_week: [monday: [], tuesday: [], wednesday: [], thursday: [], friday: [], saturday: [], sunday: []]] + [:id, :date, :time, :time_end, :rule, :until, :count, :interval, day: [], day_of_week: [monday: [], tuesday: [], wednesday: [], thursday: [], friday: [], saturday: [], sunday: []]] end - + end -end \ No newline at end of file +end diff --git a/lib/schedulable/version.rb b/lib/schedulable/version.rb index 79d3bb2..3bc57a7 100644 --- a/lib/schedulable/version.rb +++ b/lib/schedulable/version.rb @@ -1,3 +1,3 @@ module Schedulable - VERSION = "0.0.10" + VERSION = "1.1.0" end diff --git a/schedulable.gemspec b/schedulable.gemspec index ba6ea0d..287adfd 100644 --- a/schedulable.gemspec +++ b/schedulable.gemspec @@ -12,12 +12,18 @@ Gem::Specification.new do |s| s.homepage = "http://github.com/benignware" s.summary = "Handling recurring events in rails." s.description = "Handling recurring events in rails." + s.license = "MIT" s.files = Dir["{app,config,db,lib}/**/*", "MIT-LICENSE", "Rakefile", "README.md"] - s.add_dependency "rails", ">= 4.0.3" - s.add_dependency "ice_cube" - - + s.required_ruby_version = '>= 3.0.0' + s.add_dependency "rails", ">= 7.2.0" + s.add_dependency "ice_cube", "~> 0.17.0" + + s.add_development_dependency "sqlite3", "~> 1.6" + s.add_development_dependency "rspec-rails", "~> 6.0" + s.add_development_dependency "factory_bot_rails", "~> 6.2" + s.add_development_dependency "database_cleaner-active_record", "~> 2.1" + s.add_development_dependency "mutex_m", "~> 0.2.0" end diff --git a/test/dummy/app/models/event.rb b/test/dummy/app/models/event.rb index 0c410fe..0ba2fbe 100644 --- a/test/dummy/app/models/event.rb +++ b/test/dummy/app/models/event.rb @@ -1,3 +1,3 @@ class Event < ActiveRecord::Base - acts_as_schedulable :schedule, occurrences: :event_occurrences + acts_as_schedulable :schedule, occurrences: { name: :event_occurrences } end diff --git a/test/dummy/config/application.rb b/test/dummy/config/application.rb index 5394922..2a634b2 100644 --- a/test/dummy/config/application.rb +++ b/test/dummy/config/application.rb @@ -1,16 +1,26 @@ -require File.expand_path('../boot', __FILE__) +require_relative "boot" -require 'rails/all' +require "rails/all" +# Require the gems listed in Gemfile Bundler.require(*Rails.groups) require "schedulable" module Dummy class Application < Rails::Application - # Settings in config/environments/* take precedence over those specified here. - # Application configuration should go into files in config/initializers - # -- all .rb files in that directory are automatically loaded. + # Initialize configuration defaults for originally generated Rails version. + config.load_defaults 7.2 + # Please, add to the `ignore` list any other `lib` subdirectories that do + # not contain `.rb` files, or that should not be reloaded or eager loaded. + # Common ones are `templates`, `generators`, or `middleware`, for example. + config.autoload_lib(ignore: %w(assets tasks)) + + # Configuration for the application, engines, and railties goes here. + # + # These settings can be overridden in specific environments using the files + # in config/environments, which are processed later. + # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone. # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC. #config.time_zone = 'Central Time (US & Canada)' @@ -20,8 +30,7 @@ class Application < Rails::Application # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s] config.i18n.default_locale = :de - config.assets.paths << Rails.root.join('vendor', 'assets', 'components') - + # Enable CSRF tokens in remote forms config.action_view.embed_authenticity_token_in_remote_forms = true end diff --git a/test/dummy/config/boot.rb b/test/dummy/config/boot.rb index ef36047..6266cfc 100644 --- a/test/dummy/config/boot.rb +++ b/test/dummy/config/boot.rb @@ -1,5 +1,5 @@ # Set up gems listed in the Gemfile. ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../../../Gemfile', __FILE__) -require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE']) +require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE']) $LOAD_PATH.unshift File.expand_path('../../../../lib', __FILE__) diff --git a/test/dummy/config/environment.rb b/test/dummy/config/environment.rb index 10e0cad..cac5315 100644 --- a/test/dummy/config/environment.rb +++ b/test/dummy/config/environment.rb @@ -1,5 +1,5 @@ # Load the Rails application. -require File.expand_path('../application', __FILE__) +require_relative "application" # Initialize the Rails application. -Dummy::Application.initialize! +Rails.application.initialize! diff --git a/test/dummy/config/initializers/date_picker.rb b/test/dummy/config/initializers/date_picker.rb deleted file mode 100644 index 88c1936..0000000 --- a/test/dummy/config/initializers/date_picker.rb +++ /dev/null @@ -1,8 +0,0 @@ -DatePicker.configure do |config| - config.style = :bootstrap - config.formats = { - date: :default, - datetime: :default, - time: :only_time - } -end \ No newline at end of file diff --git a/test/dummy/db/test.sqlite3 b/test/dummy/db/test.sqlite3 index e69de29..6c136ed 100644 Binary files a/test/dummy/db/test.sqlite3 and b/test/dummy/db/test.sqlite3 differ diff --git a/test/dummy/db/test.sqlite3-shm b/test/dummy/db/test.sqlite3-shm new file mode 100644 index 0000000..fe9ac28 Binary files /dev/null and b/test/dummy/db/test.sqlite3-shm differ diff --git a/test/dummy/db/test.sqlite3-wal b/test/dummy/db/test.sqlite3-wal new file mode 100644 index 0000000..e69de29 diff --git a/test/dummy/log/test.log b/test/dummy/log/test.log index 4033664..0dd895b 100644 --- a/test/dummy/log/test.log +++ b/test/dummy/log/test.log @@ -943,3 +943,1383 @@ SchedulableTest: test_truth  (0.0ms) begin transaction  (0.0ms) commit transaction  (0.0ms) begin transaction +  (1.6ms) DROP TABLE IF EXISTS "event_occurrences" +  (0.6ms) CREATE TABLE "event_occurrences" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "date" datetime(6), "schedulable_id" integer, "schedulable_type" varchar, "created_at" datetime(6) NOT NULL, "updated_at" datetime(6) NOT NULL) +  (0.1ms) CREATE INDEX "index_event_occurrences_on_schedulable_type_and_schedulable_id" ON "event_occurrences" ("schedulable_type", "schedulable_id") +  (0.0ms) DROP TABLE IF EXISTS "events" +  (0.1ms) CREATE TABLE "events" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "created_at" datetime(6) NOT NULL, "updated_at" datetime(6) NOT NULL) +  (0.1ms) DROP TABLE IF EXISTS "schedules" +  (0.2ms) CREATE TABLE "schedules" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "schedulable_id" integer, "schedulable_type" varchar, "date" date, "time" time, "rule" varchar, "interval" varchar, "day" text, "day_of_week" text, "until" datetime(6), "count" integer, "created_at" datetime(6), "updated_at" datetime(6)) +  (0.6ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL PRIMARY KEY) + ActiveRecord::SchemaMigration Load (0.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC +  (0.2ms) INSERT INTO "schema_migrations" (version) VALUES (20150408191241) +  (0.0ms) INSERT INTO "schema_migrations" (version) VALUES +(20150402115511), +(20150331202637); +  (1.3ms) CREATE TABLE "ar_internal_metadata" ("key" varchar NOT NULL PRIMARY KEY, "value" varchar, "created_at" datetime(6) NOT NULL, "updated_at" datetime(6) NOT NULL) + ActiveRecord::InternalMetadata Load (1.5ms) SELECT * FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = ? ORDER BY "ar_internal_metadata"."key" ASC LIMIT 1 [[nil, "environment"]] + ActiveRecord::InternalMetadata Create (0.1ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ('environment', 'test', '2025-05-25 12:32:32.755891', '2025-05-25 12:32:32.755893') RETURNING "key" + ActiveRecord::InternalMetadata Load (0.1ms) SELECT * FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = ? ORDER BY "ar_internal_metadata"."key" ASC LIMIT 1 [[nil, "environment"]] + ActiveRecord::InternalMetadata Load (0.2ms) SELECT * FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = ? ORDER BY "ar_internal_metadata"."key" ASC LIMIT 1 [[nil, "schema_sha1"]] + ActiveRecord::InternalMetadata Create (0.1ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ('schema_sha1', '81af8182f90b7dcd786414db2156b5d89f8933ae', '2025-05-25 12:32:32.761765', '2025-05-25 12:32:32.761766') RETURNING "key" + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC + ActiveRecord::InternalMetadata Load (0.2ms) SELECT * FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = ? ORDER BY "ar_internal_metadata"."key" ASC LIMIT 1 [[nil, "schema_sha1"]] + ActiveRecord::SchemaMigration Load (0.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC + ActiveRecord::InternalMetadata Load (0.2ms) SELECT * FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = ? ORDER BY "ar_internal_metadata"."key" ASC LIMIT 1 [[nil, "schema_sha1"]] + ActiveRecord::SchemaMigration Load (0.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC + TRANSACTION (0.1ms) begin transaction +---------------------------------------------------- +SchedulableTest: test_can_create_event_with_schedule +---------------------------------------------------- + TRANSACTION (0.0ms) rollback transaction + TRANSACTION (0.0ms) begin transaction +----------------------------------- +SchedulableTest: test_module_exists +----------------------------------- + TRANSACTION (0.0ms) rollback transaction + TRANSACTION (0.1ms) begin transaction +---------------------------------------------------- +SchedulableTest: test_schedule_generates_occurrences +---------------------------------------------------- + TRANSACTION (0.0ms) rollback transaction + TRANSACTION (0.0ms) begin transaction +----------------------------------------------------- +SchedulableTest: test_schedule_has_correct_attributes +----------------------------------------------------- + TRANSACTION (0.0ms) rollback transaction + TRANSACTION (0.0ms) begin transaction +----------------------------------------------------------------- +SchedulableTest: test_schedule_serializes_day_attribute_correctly +----------------------------------------------------------------- + TRANSACTION (0.6ms) rollback transaction + TRANSACTION (0.7ms) begin transaction +------------------------------------------------------------------------- +SchedulableTest: test_schedule_serializes_day_of_week_attribute_correctly +------------------------------------------------------------------------- + TRANSACTION (0.3ms) rollback transaction + ActiveRecord::InternalMetadata Load (0.2ms) SELECT * FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = ? ORDER BY "ar_internal_metadata"."key" ASC LIMIT 1 [[nil, "schema_sha1"]] + ActiveRecord::SchemaMigration Load (0.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC + TRANSACTION (0.1ms) begin transaction +---------------------------------------------------- +SchedulableTest: test_can_create_event_with_schedule +---------------------------------------------------- + TRANSACTION (0.1ms) rollback transaction + TRANSACTION (0.0ms) begin transaction +----------------------------------- +SchedulableTest: test_module_exists +----------------------------------- + TRANSACTION (0.0ms) rollback transaction + TRANSACTION (0.1ms) begin transaction +---------------------------------------------------- +SchedulableTest: test_schedule_generates_occurrences +---------------------------------------------------- + TRANSACTION (0.0ms) rollback transaction + TRANSACTION (0.0ms) begin transaction +----------------------------------------------------- +SchedulableTest: test_schedule_has_correct_attributes +----------------------------------------------------- + TRANSACTION (0.0ms) rollback transaction + TRANSACTION (0.0ms) begin transaction +----------------------------------------------------------------- +SchedulableTest: test_schedule_serializes_day_attribute_correctly +----------------------------------------------------------------- + TRANSACTION (0.6ms) rollback transaction + TRANSACTION (0.5ms) begin transaction +------------------------------------------------------------------------- +SchedulableTest: test_schedule_serializes_day_of_week_attribute_correctly +------------------------------------------------------------------------- + TRANSACTION (0.3ms) rollback transaction + ActiveRecord::InternalMetadata Load (0.2ms) SELECT * FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = ? ORDER BY "ar_internal_metadata"."key" ASC LIMIT 1 [[nil, "schema_sha1"]] + ActiveRecord::SchemaMigration Load (0.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC + TRANSACTION (0.1ms) begin transaction +---------------------------------------------------- +SchedulableTest: test_can_create_event_with_schedule +---------------------------------------------------- + TRANSACTION (0.0ms) rollback transaction + TRANSACTION (0.0ms) begin transaction +----------------------------------- +SchedulableTest: test_module_exists +----------------------------------- + TRANSACTION (0.0ms) rollback transaction + TRANSACTION (0.1ms) begin transaction +---------------------------------------------------- +SchedulableTest: test_schedule_generates_occurrences +---------------------------------------------------- + TRANSACTION (0.1ms) rollback transaction + TRANSACTION (0.1ms) begin transaction +----------------------------------------------------- +SchedulableTest: test_schedule_has_correct_attributes +----------------------------------------------------- + TRANSACTION (0.0ms) rollback transaction + TRANSACTION (0.0ms) begin transaction +----------------------------------------------------------------- +SchedulableTest: test_schedule_serializes_day_attribute_correctly +----------------------------------------------------------------- + TRANSACTION (0.7ms) rollback transaction + TRANSACTION (0.7ms) begin transaction +------------------------------------------------------------------------- +SchedulableTest: test_schedule_serializes_day_of_week_attribute_correctly +------------------------------------------------------------------------- + TRANSACTION (0.8ms) rollback transaction + ActiveRecord::InternalMetadata Load (0.2ms) SELECT * FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = ? ORDER BY "ar_internal_metadata"."key" ASC LIMIT 1 [[nil, "schema_sha1"]] + ActiveRecord::SchemaMigration Load (0.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC + TRANSACTION (0.1ms) begin transaction +---------------------------------------------------- +SchedulableTest: test_can_create_event_with_schedule +---------------------------------------------------- + TRANSACTION (0.0ms) rollback transaction + TRANSACTION (0.0ms) begin transaction +----------------------------------- +SchedulableTest: test_module_exists +----------------------------------- + TRANSACTION (0.0ms) rollback transaction + TRANSACTION (0.1ms) begin transaction +---------------------------------------------------- +SchedulableTest: test_schedule_generates_occurrences +---------------------------------------------------- + TRANSACTION (0.0ms) rollback transaction + TRANSACTION (0.0ms) begin transaction +----------------------------------------------------- +SchedulableTest: test_schedule_has_correct_attributes +----------------------------------------------------- + TRANSACTION (0.0ms) rollback transaction + TRANSACTION (0.0ms) begin transaction +----------------------------------------------------------------- +SchedulableTest: test_schedule_serializes_day_attribute_correctly +----------------------------------------------------------------- + TRANSACTION (0.7ms) rollback transaction + TRANSACTION (0.6ms) begin transaction +------------------------------------------------------------------------- +SchedulableTest: test_schedule_serializes_day_of_week_attribute_correctly +------------------------------------------------------------------------- + TRANSACTION (0.4ms) rollback transaction + ActiveRecord::InternalMetadata Load (0.2ms) SELECT * FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = ? ORDER BY "ar_internal_metadata"."key" ASC LIMIT 1 [[nil, "schema_sha1"]] + ActiveRecord::SchemaMigration Load (0.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC + TRANSACTION (0.1ms) begin transaction +---------------------------------------------------- +SchedulableTest: test_can_create_event_with_schedule +---------------------------------------------------- + TRANSACTION (0.0ms) rollback transaction + TRANSACTION (0.0ms) begin transaction +----------------------------------- +SchedulableTest: test_module_exists +----------------------------------- + TRANSACTION (0.0ms) rollback transaction + TRANSACTION (0.1ms) begin transaction +---------------------------------------------------- +SchedulableTest: test_schedule_generates_occurrences +---------------------------------------------------- + TRANSACTION (0.0ms) rollback transaction + TRANSACTION (0.0ms) begin transaction +----------------------------------------------------- +SchedulableTest: test_schedule_has_correct_attributes +----------------------------------------------------- + TRANSACTION (0.0ms) rollback transaction + TRANSACTION (0.0ms) begin transaction +----------------------------------------------------------------- +SchedulableTest: test_schedule_serializes_day_attribute_correctly +----------------------------------------------------------------- + TRANSACTION (0.8ms) rollback transaction + TRANSACTION (0.6ms) begin transaction +------------------------------------------------------------------------- +SchedulableTest: test_schedule_serializes_day_of_week_attribute_correctly +------------------------------------------------------------------------- + TRANSACTION (0.3ms) rollback transaction + ActiveRecord::InternalMetadata Load (0.1ms) SELECT * FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = ? ORDER BY "ar_internal_metadata"."key" ASC LIMIT 1 [[nil, "schema_sha1"]] + ActiveRecord::SchemaMigration Load (0.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC + TRANSACTION (0.1ms) begin transaction +---------------------------------------------------- +SchedulableTest: test_can_create_event_with_schedule +---------------------------------------------------- + TRANSACTION (0.0ms) rollback transaction + TRANSACTION (0.0ms) begin transaction +----------------------------------- +SchedulableTest: test_module_exists +----------------------------------- + TRANSACTION (0.0ms) rollback transaction + TRANSACTION (0.1ms) begin transaction +---------------------------------------------------- +SchedulableTest: test_schedule_generates_occurrences +---------------------------------------------------- + TRANSACTION (0.0ms) rollback transaction + TRANSACTION (0.0ms) begin transaction +----------------------------------------------------- +SchedulableTest: test_schedule_has_correct_attributes +----------------------------------------------------- + TRANSACTION (0.0ms) rollback transaction + TRANSACTION (0.1ms) begin transaction +----------------------------------------------------------------- +SchedulableTest: test_schedule_serializes_day_attribute_correctly +----------------------------------------------------------------- + TRANSACTION (0.8ms) rollback transaction + TRANSACTION (0.6ms) begin transaction +------------------------------------------------------------------------- +SchedulableTest: test_schedule_serializes_day_of_week_attribute_correctly +------------------------------------------------------------------------- + TRANSACTION (0.3ms) rollback transaction + ActiveRecord::InternalMetadata Load (0.2ms) SELECT * FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = ? ORDER BY "ar_internal_metadata"."key" ASC LIMIT 1 [[nil, "schema_sha1"]] + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC + TRANSACTION (0.1ms) begin transaction +---------------------------------------------------- +SchedulableTest: test_can_create_event_with_schedule +---------------------------------------------------- + TRANSACTION (0.0ms) rollback transaction + TRANSACTION (0.0ms) begin transaction +----------------------------------- +SchedulableTest: test_module_exists +----------------------------------- + TRANSACTION (0.0ms) rollback transaction + TRANSACTION (0.1ms) begin transaction +---------------------------------------------------- +SchedulableTest: test_schedule_generates_occurrences +---------------------------------------------------- + TRANSACTION (0.0ms) rollback transaction + TRANSACTION (0.0ms) begin transaction +----------------------------------------------------- +SchedulableTest: test_schedule_has_correct_attributes +----------------------------------------------------- + TRANSACTION (0.0ms) rollback transaction + TRANSACTION (0.0ms) begin transaction +----------------------------------------------------------------- +SchedulableTest: test_schedule_serializes_day_attribute_correctly +----------------------------------------------------------------- + TRANSACTION (0.6ms) rollback transaction + TRANSACTION (0.6ms) begin transaction +------------------------------------------------------------------------- +SchedulableTest: test_schedule_serializes_day_of_week_attribute_correctly +------------------------------------------------------------------------- + TRANSACTION (0.3ms) rollback transaction + ActiveRecord::InternalMetadata Load (0.2ms) SELECT * FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = ? ORDER BY "ar_internal_metadata"."key" ASC LIMIT 1 [[nil, "schema_sha1"]] + ActiveRecord::SchemaMigration Load (0.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC + TRANSACTION (0.1ms) begin transaction +---------------------------------------------------- +SchedulableTest: test_can_create_event_with_schedule +---------------------------------------------------- + TRANSACTION (0.0ms) rollback transaction + TRANSACTION (0.0ms) begin transaction +----------------------------------- +SchedulableTest: test_module_exists +----------------------------------- + TRANSACTION (0.0ms) rollback transaction + TRANSACTION (0.1ms) begin transaction +---------------------------------------------------- +SchedulableTest: test_schedule_generates_occurrences +---------------------------------------------------- + TRANSACTION (0.0ms) rollback transaction + TRANSACTION (0.0ms) begin transaction +----------------------------------------------------- +SchedulableTest: test_schedule_has_correct_attributes +----------------------------------------------------- + TRANSACTION (0.0ms) rollback transaction + TRANSACTION (0.0ms) begin transaction +----------------------------------------------------------------- +SchedulableTest: test_schedule_serializes_day_attribute_correctly +----------------------------------------------------------------- + TRANSACTION (0.6ms) rollback transaction + TRANSACTION (0.6ms) begin transaction +------------------------------------------------------------------------- +SchedulableTest: test_schedule_serializes_day_of_week_attribute_correctly +------------------------------------------------------------------------- + TRANSACTION (0.3ms) rollback transaction + ActiveRecord::InternalMetadata Load (0.2ms) SELECT * FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = ? ORDER BY "ar_internal_metadata"."key" ASC LIMIT 1 [[nil, "schema_sha1"]] + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC + TRANSACTION (0.1ms) begin transaction +---------------------------------------------------- +SchedulableTest: test_can_create_event_with_schedule +---------------------------------------------------- + TRANSACTION (0.0ms) rollback transaction + TRANSACTION (0.0ms) begin transaction +----------------------------------- +SchedulableTest: test_module_exists +----------------------------------- + TRANSACTION (0.0ms) rollback transaction + TRANSACTION (0.1ms) begin transaction +---------------------------------------------------- +SchedulableTest: test_schedule_generates_occurrences +---------------------------------------------------- + TRANSACTION (0.0ms) rollback transaction + TRANSACTION (0.0ms) begin transaction +----------------------------------------------------- +SchedulableTest: test_schedule_has_correct_attributes +----------------------------------------------------- + TRANSACTION (0.0ms) rollback transaction + TRANSACTION (0.0ms) begin transaction +----------------------------------------------------------------- +SchedulableTest: test_schedule_serializes_day_attribute_correctly +----------------------------------------------------------------- + TRANSACTION (0.6ms) rollback transaction + TRANSACTION (0.6ms) begin transaction +------------------------------------------------------------------------- +SchedulableTest: test_schedule_serializes_day_of_week_attribute_correctly +------------------------------------------------------------------------- + TRANSACTION (0.3ms) rollback transaction + ActiveRecord::InternalMetadata Load (0.2ms) SELECT * FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = ? ORDER BY "ar_internal_metadata"."key" ASC LIMIT 1 [[nil, "schema_sha1"]] + ActiveRecord::SchemaMigration Load (0.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC + TRANSACTION (0.1ms) begin transaction +---------------------------------------------------- +SchedulableTest: test_can_create_event_with_schedule +---------------------------------------------------- + TRANSACTION (0.0ms) rollback transaction + TRANSACTION (0.0ms) begin transaction +----------------------------------- +SchedulableTest: test_module_exists +----------------------------------- + TRANSACTION (0.0ms) rollback transaction + TRANSACTION (0.1ms) begin transaction +---------------------------------------------------- +SchedulableTest: test_schedule_generates_occurrences +---------------------------------------------------- + TRANSACTION (0.0ms) rollback transaction + TRANSACTION (0.0ms) begin transaction +----------------------------------------------------- +SchedulableTest: test_schedule_has_correct_attributes +----------------------------------------------------- + TRANSACTION (0.0ms) rollback transaction + TRANSACTION (0.0ms) begin transaction +----------------------------------------------------------------- +SchedulableTest: test_schedule_serializes_day_attribute_correctly +----------------------------------------------------------------- + TRANSACTION (0.7ms) rollback transaction + TRANSACTION (0.6ms) begin transaction +------------------------------------------------------------------------- +SchedulableTest: test_schedule_serializes_day_of_week_attribute_correctly +------------------------------------------------------------------------- + TRANSACTION (0.3ms) rollback transaction + ActiveRecord::InternalMetadata Load (0.5ms) SELECT * FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = ? ORDER BY "ar_internal_metadata"."key" ASC LIMIT 1 [[nil, "schema_sha1"]] + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC + TRANSACTION (0.1ms) begin transaction +---------------------------------------------------- +SchedulableTest: test_can_create_event_with_schedule +---------------------------------------------------- + TRANSACTION (0.0ms) SAVEPOINT active_record_1 + Schedule Create (0.5ms) INSERT INTO "schedules" ("schedulable_id", "schedulable_type", "date", "time", "rule", "interval", "day", "day_of_week", "until", "count", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING "id" [["schedulable_id", nil], ["schedulable_type", nil], ["date", nil], ["time", "2000-01-01 07:40:25.646908"], ["rule", "weekly"], ["interval", nil], ["day", "---\n- monday\n"], ["day_of_week", nil], ["until", "2025-12-22 06:40:25.646962"], ["count", 10], ["created_at", "2025-09-22 05:40:25.647890"], ["updated_at", "2025-09-22 05:40:25.647890"]] + TRANSACTION (0.5ms) RELEASE SAVEPOINT active_record_1 + TRANSACTION (0.1ms) SAVEPOINT active_record_1 + Event Create (0.5ms) INSERT INTO "events" ("name", "created_at", "updated_at") VALUES (?, ?, ?) RETURNING "id" [["name", "My Event"], ["created_at", "2025-09-22 05:40:25.660282"], ["updated_at", "2025-09-22 05:40:25.660282"]] + Schedule Update (0.9ms) UPDATE "schedules" SET "schedulable_id" = ?, "schedulable_type" = ?, "updated_at" = ? WHERE "schedules"."id" = ? [["schedulable_id", 1], ["schedulable_type", "Event"], ["updated_at", "2025-09-22 05:40:25.701679"], ["id", 1]] + TRANSACTION (0.1ms) ROLLBACK TO SAVEPOINT active_record_1 + TRANSACTION (2.5ms) rollback transaction + TRANSACTION (0.3ms) begin transaction +----------------------------------- +SchedulableTest: test_module_exists +----------------------------------- + TRANSACTION (0.3ms) SAVEPOINT active_record_1 + Schedule Create (1.3ms) INSERT INTO "schedules" ("schedulable_id", "schedulable_type", "date", "time", "rule", "interval", "day", "day_of_week", "until", "count", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING "id" [["schedulable_id", nil], ["schedulable_type", nil], ["date", nil], ["time", "2000-01-01 07:40:25.794281"], ["rule", "weekly"], ["interval", nil], ["day", "---\n- monday\n"], ["day_of_week", nil], ["until", "2025-12-22 06:40:25.794857"], ["count", 10], ["created_at", "2025-09-22 05:40:25.829474"], ["updated_at", "2025-09-22 05:40:25.829474"]] + TRANSACTION (0.2ms) RELEASE SAVEPOINT active_record_1 + TRANSACTION (0.8ms) SAVEPOINT active_record_1 + Event Create (3.3ms) INSERT INTO "events" ("name", "created_at", "updated_at") VALUES (?, ?, ?) RETURNING "id" [["name", "My Event"], ["created_at", "2025-09-22 05:40:25.855523"], ["updated_at", "2025-09-22 05:40:25.855523"]] + Schedule Update (1.1ms) UPDATE "schedules" SET "schedulable_id" = ?, "schedulable_type" = ?, "updated_at" = ? WHERE "schedules"."id" = ? [["schedulable_id", 1], ["schedulable_type", "Event"], ["updated_at", "2025-09-22 05:40:25.862792"], ["id", 1]] + TRANSACTION (0.2ms) ROLLBACK TO SAVEPOINT active_record_1 + TRANSACTION (0.9ms) rollback transaction + TRANSACTION (0.9ms) begin transaction +---------------------------------------------------- +SchedulableTest: test_schedule_generates_occurrences +---------------------------------------------------- + TRANSACTION (0.1ms) SAVEPOINT active_record_1 + Schedule Create (0.7ms) INSERT INTO "schedules" ("schedulable_id", "schedulable_type", "date", "time", "rule", "interval", "day", "day_of_week", "until", "count", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING "id" [["schedulable_id", nil], ["schedulable_type", nil], ["date", nil], ["time", "2000-01-01 07:40:25.882092"], ["rule", "weekly"], ["interval", nil], ["day", "---\n- monday\n"], ["day_of_week", nil], ["until", "2025-12-22 06:40:25.882142"], ["count", 10], ["created_at", "2025-09-22 05:40:25.882948"], ["updated_at", "2025-09-22 05:40:25.882948"]] + TRANSACTION (1.0ms) RELEASE SAVEPOINT active_record_1 + TRANSACTION (0.0ms) SAVEPOINT active_record_1 + Event Create (2.6ms) INSERT INTO "events" ("name", "created_at", "updated_at") VALUES (?, ?, ?) RETURNING "id" [["name", "My Event"], ["created_at", "2025-09-22 05:40:25.891145"], ["updated_at", "2025-09-22 05:40:25.891145"]] + Schedule Update (0.1ms) UPDATE "schedules" SET "schedulable_id" = ?, "schedulable_type" = ?, "updated_at" = ? WHERE "schedules"."id" = ? [["schedulable_id", 1], ["schedulable_type", "Event"], ["updated_at", "2025-09-22 05:40:25.894529"], ["id", 1]] + TRANSACTION (0.0ms) ROLLBACK TO SAVEPOINT active_record_1 + TRANSACTION (0.4ms) rollback transaction + TRANSACTION (0.0ms) begin transaction +----------------------------------------------------- +SchedulableTest: test_schedule_has_correct_attributes +----------------------------------------------------- + TRANSACTION (0.0ms) SAVEPOINT active_record_1 + Schedule Create (1.4ms) INSERT INTO "schedules" ("schedulable_id", "schedulable_type", "date", "time", "rule", "interval", "day", "day_of_week", "until", "count", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING "id" [["schedulable_id", nil], ["schedulable_type", nil], ["date", nil], ["time", "2000-01-01 07:40:25.901213"], ["rule", "weekly"], ["interval", nil], ["day", "---\n- monday\n"], ["day_of_week", nil], ["until", "2025-12-22 06:40:25.901342"], ["count", 10], ["created_at", "2025-09-22 05:40:25.903640"], ["updated_at", "2025-09-22 05:40:25.903640"]] + TRANSACTION (0.0ms) RELEASE SAVEPOINT active_record_1 + TRANSACTION (0.0ms) SAVEPOINT active_record_1 + Event Create (2.3ms) INSERT INTO "events" ("name", "created_at", "updated_at") VALUES (?, ?, ?) RETURNING "id" [["name", "My Event"], ["created_at", "2025-09-22 05:40:25.906921"], ["updated_at", "2025-09-22 05:40:25.906921"]] + Schedule Update (0.0ms) UPDATE "schedules" SET "schedulable_id" = ?, "schedulable_type" = ?, "updated_at" = ? WHERE "schedules"."id" = ? [["schedulable_id", 1], ["schedulable_type", "Event"], ["updated_at", "2025-09-22 05:40:25.909621"], ["id", 1]] + TRANSACTION (0.0ms) ROLLBACK TO SAVEPOINT active_record_1 + TRANSACTION (0.0ms) rollback transaction + TRANSACTION (0.0ms) begin transaction +----------------------------------------------------------------- +SchedulableTest: test_schedule_serializes_day_attribute_correctly +----------------------------------------------------------------- + TRANSACTION (0.0ms) SAVEPOINT active_record_1 + Schedule Create (0.2ms) INSERT INTO "schedules" ("schedulable_id", "schedulable_type", "date", "time", "rule", "interval", "day", "day_of_week", "until", "count", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING "id" [["schedulable_id", nil], ["schedulable_type", nil], ["date", nil], ["time", "2000-01-01 07:40:25.915746"], ["rule", "weekly"], ["interval", nil], ["day", "---\n- monday\n"], ["day_of_week", nil], ["until", "2025-12-22 06:40:25.916064"], ["count", 10], ["created_at", "2025-09-22 05:40:25.916818"], ["updated_at", "2025-09-22 05:40:25.916818"]] + TRANSACTION (0.0ms) RELEASE SAVEPOINT active_record_1 + TRANSACTION (0.0ms) SAVEPOINT active_record_1 + Event Create (0.4ms) INSERT INTO "events" ("name", "created_at", "updated_at") VALUES (?, ?, ?) RETURNING "id" [["name", "My Event"], ["created_at", "2025-09-22 05:40:25.919969"], ["updated_at", "2025-09-22 05:40:25.919969"]] + Schedule Update (0.2ms) UPDATE "schedules" SET "schedulable_id" = ?, "schedulable_type" = ?, "updated_at" = ? WHERE "schedules"."id" = ? [["schedulable_id", 1], ["schedulable_type", "Event"], ["updated_at", "2025-09-22 05:40:25.920649"], ["id", 1]] + TRANSACTION (0.0ms) ROLLBACK TO SAVEPOINT active_record_1 + TRANSACTION (0.0ms) rollback transaction + TRANSACTION (0.0ms) begin transaction +------------------------------------------------------------------------- +SchedulableTest: test_schedule_serializes_day_of_week_attribute_correctly +------------------------------------------------------------------------- + TRANSACTION (0.0ms) SAVEPOINT active_record_1 + Schedule Create (0.2ms) INSERT INTO "schedules" ("schedulable_id", "schedulable_type", "date", "time", "rule", "interval", "day", "day_of_week", "until", "count", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING "id" [["schedulable_id", nil], ["schedulable_type", nil], ["date", nil], ["time", "2000-01-01 07:40:25.924834"], ["rule", "weekly"], ["interval", nil], ["day", "---\n- monday\n"], ["day_of_week", nil], ["until", "2025-12-22 06:40:25.924879"], ["count", 10], ["created_at", "2025-09-22 05:40:25.925337"], ["updated_at", "2025-09-22 05:40:25.925337"]] + TRANSACTION (0.0ms) RELEASE SAVEPOINT active_record_1 + TRANSACTION (0.0ms) SAVEPOINT active_record_1 + Event Create (0.1ms) INSERT INTO "events" ("name", "created_at", "updated_at") VALUES (?, ?, ?) RETURNING "id" [["name", "My Event"], ["created_at", "2025-09-22 05:40:25.926869"], ["updated_at", "2025-09-22 05:40:25.926869"]] + Schedule Update (0.0ms) UPDATE "schedules" SET "schedulable_id" = ?, "schedulable_type" = ?, "updated_at" = ? WHERE "schedules"."id" = ? [["schedulable_id", 1], ["schedulable_type", "Event"], ["updated_at", "2025-09-22 05:40:25.927233"], ["id", 1]] + TRANSACTION (0.0ms) ROLLBACK TO SAVEPOINT active_record_1 + TRANSACTION (0.0ms) rollback transaction + ActiveRecord::InternalMetadata Load (0.2ms) SELECT * FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = ? ORDER BY "ar_internal_metadata"."key" ASC LIMIT 1 [[nil, "schema_sha1"]] + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC + TRANSACTION (0.1ms) begin transaction +---------------------------------------------------- +SchedulableTest: test_can_create_event_with_schedule +---------------------------------------------------- + TRANSACTION (0.2ms) rollback transaction + TRANSACTION (0.6ms) begin transaction +----------------------------------- +SchedulableTest: test_module_exists +----------------------------------- + TRANSACTION (0.0ms) rollback transaction + TRANSACTION (0.0ms) begin transaction +---------------------------------------------------- +SchedulableTest: test_schedule_generates_occurrences +---------------------------------------------------- + TRANSACTION (0.0ms) rollback transaction + TRANSACTION (0.0ms) begin transaction +----------------------------------------------------- +SchedulableTest: test_schedule_has_correct_attributes +----------------------------------------------------- + TRANSACTION (0.2ms) rollback transaction + TRANSACTION (0.1ms) begin transaction +----------------------------------------------------------------- +SchedulableTest: test_schedule_serializes_day_attribute_correctly +----------------------------------------------------------------- + TRANSACTION (0.0ms) rollback transaction + TRANSACTION (0.3ms) begin transaction +------------------------------------------------------------------------- +SchedulableTest: test_schedule_serializes_day_of_week_attribute_correctly +------------------------------------------------------------------------- + TRANSACTION (0.3ms) rollback transaction + ActiveRecord::InternalMetadata Load (0.2ms) SELECT * FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = ? ORDER BY "ar_internal_metadata"."key" ASC LIMIT 1 [[nil, "schema_sha1"]] + ActiveRecord::SchemaMigration Load (0.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC + TRANSACTION (0.1ms) begin transaction +---------------------------------------------------- +SchedulableTest: test_can_create_event_with_schedule +---------------------------------------------------- + TRANSACTION (0.1ms) rollback transaction + TRANSACTION (0.9ms) begin transaction +----------------------------------- +SchedulableTest: test_module_exists +----------------------------------- + TRANSACTION (0.0ms) rollback transaction + TRANSACTION (0.0ms) begin transaction +---------------------------------------------------- +SchedulableTest: test_schedule_generates_occurrences +---------------------------------------------------- + TRANSACTION (0.0ms) rollback transaction + TRANSACTION (0.0ms) begin transaction +----------------------------------------------------- +SchedulableTest: test_schedule_has_correct_attributes +----------------------------------------------------- + TRANSACTION (0.3ms) rollback transaction + TRANSACTION (0.1ms) begin transaction +----------------------------------------------------------------- +SchedulableTest: test_schedule_serializes_day_attribute_correctly +----------------------------------------------------------------- + TRANSACTION (0.0ms) rollback transaction + TRANSACTION (0.3ms) begin transaction +------------------------------------------------------------------------- +SchedulableTest: test_schedule_serializes_day_of_week_attribute_correctly +------------------------------------------------------------------------- + TRANSACTION (0.3ms) rollback transaction + ActiveRecord::InternalMetadata Load (0.2ms) SELECT * FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = ? ORDER BY "ar_internal_metadata"."key" ASC LIMIT 1 [[nil, "schema_sha1"]] + ActiveRecord::SchemaMigration Load (0.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC + TRANSACTION (0.3ms) begin transaction +---------------------------------------------------- +SchedulableTest: test_can_create_event_with_schedule +---------------------------------------------------- + TRANSACTION (0.0ms) SAVEPOINT active_record_1 + Schedule Create (0.5ms) INSERT INTO "schedules" ("schedulable_id", "schedulable_type", "date", "time", "rule", "interval", "day", "day_of_week", "until", "count", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING "id" [["schedulable_id", nil], ["schedulable_type", nil], ["date", nil], ["time", "2000-01-01 07:42:58.500775"], ["rule", "weekly"], ["interval", nil], ["day", "---\n- monday\n"], ["day_of_week", nil], ["until", "2025-12-22 06:42:58.500829"], ["count", 10], ["created_at", "2025-09-22 05:42:58.509509"], ["updated_at", "2025-09-22 05:42:58.509509"]] + TRANSACTION (0.6ms) RELEASE SAVEPOINT active_record_1 + TRANSACTION (0.0ms) SAVEPOINT active_record_1 + Event Create (0.4ms) INSERT INTO "events" ("name", "created_at", "updated_at") VALUES (?, ?, ?) RETURNING "id" [["name", "My Event"], ["created_at", "2025-09-22 05:42:58.522362"], ["updated_at", "2025-09-22 05:42:58.522362"]] + Schedule Update (0.3ms) UPDATE "schedules" SET "schedulable_id" = ?, "schedulable_type" = ?, "updated_at" = ? WHERE "schedules"."id" = ? [["schedulable_id", 1], ["schedulable_type", "Event"], ["updated_at", "2025-09-22 05:42:58.535139"], ["id", 1]] + TRANSACTION (0.0ms) ROLLBACK TO SAVEPOINT active_record_1 + TRANSACTION (0.3ms) rollback transaction + TRANSACTION (0.3ms) begin transaction +----------------------------------- +SchedulableTest: test_module_exists +----------------------------------- + TRANSACTION (0.3ms) SAVEPOINT active_record_1 + Schedule Create (1.1ms) INSERT INTO "schedules" ("schedulable_id", "schedulable_type", "date", "time", "rule", "interval", "day", "day_of_week", "until", "count", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING "id" [["schedulable_id", nil], ["schedulable_type", nil], ["date", nil], ["time", "2000-01-01 07:42:58.567854"], ["rule", "weekly"], ["interval", nil], ["day", "---\n- monday\n"], ["day_of_week", nil], ["until", "2025-12-22 06:42:58.567962"], ["count", 10], ["created_at", "2025-09-22 05:42:58.576857"], ["updated_at", "2025-09-22 05:42:58.576857"]] + TRANSACTION (0.2ms) RELEASE SAVEPOINT active_record_1 + TRANSACTION (0.7ms) SAVEPOINT active_record_1 + Event Create (2.6ms) INSERT INTO "events" ("name", "created_at", "updated_at") VALUES (?, ?, ?) RETURNING "id" [["name", "My Event"], ["created_at", "2025-09-22 05:42:58.587213"], ["updated_at", "2025-09-22 05:42:58.587213"]] + Schedule Update (0.9ms) UPDATE "schedules" SET "schedulable_id" = ?, "schedulable_type" = ?, "updated_at" = ? WHERE "schedules"."id" = ? [["schedulable_id", 1], ["schedulable_type", "Event"], ["updated_at", "2025-09-22 05:42:58.592946"], ["id", 1]] + TRANSACTION (0.1ms) ROLLBACK TO SAVEPOINT active_record_1 + TRANSACTION (0.7ms) rollback transaction + TRANSACTION (0.5ms) begin transaction +---------------------------------------------------- +SchedulableTest: test_schedule_generates_occurrences +---------------------------------------------------- + TRANSACTION (0.0ms) SAVEPOINT active_record_1 + Schedule Create (0.4ms) INSERT INTO "schedules" ("schedulable_id", "schedulable_type", "date", "time", "rule", "interval", "day", "day_of_week", "until", "count", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING "id" [["schedulable_id", nil], ["schedulable_type", nil], ["date", nil], ["time", "2000-01-01 07:42:58.600947"], ["rule", "weekly"], ["interval", nil], ["day", "---\n- monday\n"], ["day_of_week", nil], ["until", "2025-12-22 06:42:58.600977"], ["count", 10], ["created_at", "2025-09-22 05:42:58.601296"], ["updated_at", "2025-09-22 05:42:58.601296"]] + TRANSACTION (0.1ms) RELEASE SAVEPOINT active_record_1 + TRANSACTION (0.0ms) SAVEPOINT active_record_1 + Event Create (0.1ms) INSERT INTO "events" ("name", "created_at", "updated_at") VALUES (?, ?, ?) RETURNING "id" [["name", "My Event"], ["created_at", "2025-09-22 05:42:58.604817"], ["updated_at", "2025-09-22 05:42:58.604817"]] + Schedule Update (0.0ms) UPDATE "schedules" SET "schedulable_id" = ?, "schedulable_type" = ?, "updated_at" = ? WHERE "schedules"."id" = ? [["schedulable_id", 1], ["schedulable_type", "Event"], ["updated_at", "2025-09-22 05:42:58.605333"], ["id", 1]] + TRANSACTION (0.0ms) ROLLBACK TO SAVEPOINT active_record_1 + TRANSACTION (0.3ms) rollback transaction + TRANSACTION (0.0ms) begin transaction +----------------------------------------------------- +SchedulableTest: test_schedule_has_correct_attributes +----------------------------------------------------- + TRANSACTION (0.0ms) SAVEPOINT active_record_1 + Schedule Create (0.6ms) INSERT INTO "schedules" ("schedulable_id", "schedulable_type", "date", "time", "rule", "interval", "day", "day_of_week", "until", "count", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING "id" [["schedulable_id", nil], ["schedulable_type", nil], ["date", nil], ["time", "2000-01-01 07:42:58.610571"], ["rule", "weekly"], ["interval", nil], ["day", "---\n- monday\n"], ["day_of_week", nil], ["until", "2025-12-22 06:42:58.610687"], ["count", 10], ["created_at", "2025-09-22 05:42:58.612318"], ["updated_at", "2025-09-22 05:42:58.612318"]] + TRANSACTION (0.0ms) RELEASE SAVEPOINT active_record_1 + TRANSACTION (0.0ms) SAVEPOINT active_record_1 + Event Create (0.1ms) INSERT INTO "events" ("name", "created_at", "updated_at") VALUES (?, ?, ?) RETURNING "id" [["name", "My Event"], ["created_at", "2025-09-22 05:42:58.614038"], ["updated_at", "2025-09-22 05:42:58.614038"]] + Schedule Update (0.0ms) UPDATE "schedules" SET "schedulable_id" = ?, "schedulable_type" = ?, "updated_at" = ? WHERE "schedules"."id" = ? [["schedulable_id", 1], ["schedulable_type", "Event"], ["updated_at", "2025-09-22 05:42:58.614868"], ["id", 1]] + TRANSACTION (0.0ms) ROLLBACK TO SAVEPOINT active_record_1 + TRANSACTION (0.0ms) rollback transaction + TRANSACTION (0.0ms) begin transaction +----------------------------------------------------------------- +SchedulableTest: test_schedule_serializes_day_attribute_correctly +----------------------------------------------------------------- + TRANSACTION (0.0ms) SAVEPOINT active_record_1 + Schedule Create (0.1ms) INSERT INTO "schedules" ("schedulable_id", "schedulable_type", "date", "time", "rule", "interval", "day", "day_of_week", "until", "count", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING "id" [["schedulable_id", nil], ["schedulable_type", nil], ["date", nil], ["time", "2000-01-01 07:42:58.620344"], ["rule", "weekly"], ["interval", nil], ["day", "---\n- monday\n"], ["day_of_week", nil], ["until", "2025-12-22 06:42:58.620598"], ["count", 10], ["created_at", "2025-09-22 05:42:58.621121"], ["updated_at", "2025-09-22 05:42:58.621121"]] + TRANSACTION (0.0ms) RELEASE SAVEPOINT active_record_1 + TRANSACTION (0.0ms) SAVEPOINT active_record_1 + Event Create (0.3ms) INSERT INTO "events" ("name", "created_at", "updated_at") VALUES (?, ?, ?) RETURNING "id" [["name", "My Event"], ["created_at", "2025-09-22 05:42:58.623753"], ["updated_at", "2025-09-22 05:42:58.623753"]] + Schedule Update (0.1ms) UPDATE "schedules" SET "schedulable_id" = ?, "schedulable_type" = ?, "updated_at" = ? WHERE "schedules"."id" = ? [["schedulable_id", 1], ["schedulable_type", "Event"], ["updated_at", "2025-09-22 05:42:58.624625"], ["id", 1]] + TRANSACTION (0.0ms) ROLLBACK TO SAVEPOINT active_record_1 + TRANSACTION (0.0ms) rollback transaction + TRANSACTION (0.0ms) begin transaction +------------------------------------------------------------------------- +SchedulableTest: test_schedule_serializes_day_of_week_attribute_correctly +------------------------------------------------------------------------- + TRANSACTION (0.0ms) SAVEPOINT active_record_1 + Schedule Create (0.1ms) INSERT INTO "schedules" ("schedulable_id", "schedulable_type", "date", "time", "rule", "interval", "day", "day_of_week", "until", "count", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING "id" [["schedulable_id", nil], ["schedulable_type", nil], ["date", nil], ["time", "2000-01-01 07:42:58.627584"], ["rule", "weekly"], ["interval", nil], ["day", "---\n- monday\n"], ["day_of_week", nil], ["until", "2025-12-22 06:42:58.627616"], ["count", 10], ["created_at", "2025-09-22 05:42:58.627994"], ["updated_at", "2025-09-22 05:42:58.627994"]] + TRANSACTION (0.0ms) RELEASE SAVEPOINT active_record_1 + TRANSACTION (0.0ms) SAVEPOINT active_record_1 + Event Create (0.1ms) INSERT INTO "events" ("name", "created_at", "updated_at") VALUES (?, ?, ?) RETURNING "id" [["name", "My Event"], ["created_at", "2025-09-22 05:42:58.629068"], ["updated_at", "2025-09-22 05:42:58.629068"]] + Schedule Update (0.0ms) UPDATE "schedules" SET "schedulable_id" = ?, "schedulable_type" = ?, "updated_at" = ? WHERE "schedules"."id" = ? [["schedulable_id", 1], ["schedulable_type", "Event"], ["updated_at", "2025-09-22 05:42:58.629360"], ["id", 1]] + TRANSACTION (0.0ms) ROLLBACK TO SAVEPOINT active_record_1 + TRANSACTION (0.0ms) rollback transaction + ActiveRecord::InternalMetadata Load (0.4ms) SELECT * FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = ? ORDER BY "ar_internal_metadata"."key" ASC LIMIT 1 [[nil, "schema_sha1"]] + ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC + TRANSACTION (0.1ms) begin transaction +---------------------------------------------------- +SchedulableTest: test_can_create_event_with_schedule +---------------------------------------------------- + TRANSACTION (0.0ms) SAVEPOINT active_record_1 + Schedule Create (0.8ms) INSERT INTO "schedules" ("schedulable_id", "schedulable_type", "date", "time", "rule", "interval", "day", "day_of_week", "until", "count", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING "id" [["schedulable_id", nil], ["schedulable_type", nil], ["date", nil], ["time", "2000-01-01 07:44:02.763009"], ["rule", "weekly"], ["interval", nil], ["day", "---\n- monday\n"], ["day_of_week", nil], ["until", "2025-12-22 06:44:02.763076"], ["count", 10], ["created_at", "2025-09-22 05:44:02.776007"], ["updated_at", "2025-09-22 05:44:02.776007"]] + TRANSACTION (0.6ms) RELEASE SAVEPOINT active_record_1 + TRANSACTION (0.0ms) SAVEPOINT active_record_1 + Event Create (0.4ms) INSERT INTO "events" ("name", "created_at", "updated_at") VALUES (?, ?, ?) RETURNING "id" [["name", "My Event"], ["created_at", "2025-09-22 05:44:02.789376"], ["updated_at", "2025-09-22 05:44:02.789376"]] + Schedule Update (0.4ms) UPDATE "schedules" SET "schedulable_id" = ?, "schedulable_type" = ?, "updated_at" = ? WHERE "schedules"."id" = ? [["schedulable_id", 1], ["schedulable_type", "Event"], ["updated_at", "2025-09-22 05:44:02.802287"], ["id", 1]] + EventOccurrence Load (0.6ms) SELECT "event_occurrences".* FROM "event_occurrences" WHERE "event_occurrences"."schedulable_id" = ? AND "event_occurrences"."schedulable_type" = ? AND (event_occurrences.date >= ? AND schedulable_type = ?) ORDER BY date ASC [["schedulable_id", 1], ["schedulable_type", "Event"], [nil, "2025-09-22 05:44:02.868446"], [nil, "EventOccurrence"]] + EventOccurrence Create (0.3ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-09-22 06:44:02"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:44:02.886057"], ["updated_at", "2025-09-22 05:44:02.886057"]] + EventOccurrence Create (0.3ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-09-29 06:44:02"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:44:02.889834"], ["updated_at", "2025-09-22 05:44:02.889834"]] + EventOccurrence Create (2.2ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-10-06 06:44:02"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:44:02.895950"], ["updated_at", "2025-09-22 05:44:02.895950"]] + EventOccurrence Create (0.1ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-10-13 06:44:02"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:44:02.902021"], ["updated_at", "2025-09-22 05:44:02.902021"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-10-20 06:44:02"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:44:02.904964"], ["updated_at", "2025-09-22 05:44:02.904964"]] + EventOccurrence Create (0.3ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-10-27 07:44:02"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:44:02.909828"], ["updated_at", "2025-09-22 05:44:02.909828"]] + EventOccurrence Create (0.2ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-11-03 07:44:02"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:44:02.913050"], ["updated_at", "2025-09-22 05:44:02.913050"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-11-10 07:44:02"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:44:02.915373"], ["updated_at", "2025-09-22 05:44:02.915373"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-11-17 07:44:02"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:44:02.917894"], ["updated_at", "2025-09-22 05:44:02.917894"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-11-24 07:44:02"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:44:02.918985"], ["updated_at", "2025-09-22 05:44:02.918985"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-12-01 07:44:02"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:44:02.920051"], ["updated_at", "2025-09-22 05:44:02.920051"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-12-08 07:44:02"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:44:02.920958"], ["updated_at", "2025-09-22 05:44:02.920958"]] + EventOccurrence Load (0.1ms) SELECT "event_occurrences".* FROM "event_occurrences" WHERE "event_occurrences"."schedulable_id" = ? AND "event_occurrences"."schedulable_type" = ? AND (event_occurrences.date >= ? AND schedulable_type = ?) ORDER BY date ASC [["schedulable_id", 1], ["schedulable_type", "Event"], [nil, "2025-09-22 05:44:02.921701"], [nil, "EventOccurrence"]] + TRANSACTION (0.5ms) RELEASE SAVEPOINT active_record_1 + TRANSACTION (0.5ms) rollback transaction + TRANSACTION (0.6ms) begin transaction +----------------------------------- +SchedulableTest: test_module_exists +----------------------------------- + TRANSACTION (0.1ms) SAVEPOINT active_record_1 + Schedule Create (0.3ms) INSERT INTO "schedules" ("schedulable_id", "schedulable_type", "date", "time", "rule", "interval", "day", "day_of_week", "until", "count", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING "id" [["schedulable_id", nil], ["schedulable_type", nil], ["date", nil], ["time", "2000-01-01 07:44:02.937882"], ["rule", "weekly"], ["interval", nil], ["day", "---\n- monday\n"], ["day_of_week", nil], ["until", "2025-12-22 06:44:02.938541"], ["count", 10], ["created_at", "2025-09-22 05:44:02.945389"], ["updated_at", "2025-09-22 05:44:02.945389"]] + TRANSACTION (0.0ms) RELEASE SAVEPOINT active_record_1 + TRANSACTION (0.0ms) SAVEPOINT active_record_1 + Event Create (0.3ms) INSERT INTO "events" ("name", "created_at", "updated_at") VALUES (?, ?, ?) RETURNING "id" [["name", "My Event"], ["created_at", "2025-09-22 05:44:02.954766"], ["updated_at", "2025-09-22 05:44:02.954766"]] + Schedule Update (0.0ms) UPDATE "schedules" SET "schedulable_id" = ?, "schedulable_type" = ?, "updated_at" = ? WHERE "schedules"."id" = ? [["schedulable_id", 1], ["schedulable_type", "Event"], ["updated_at", "2025-09-22 05:44:02.958241"], ["id", 1]] + EventOccurrence Load (0.1ms) SELECT "event_occurrences".* FROM "event_occurrences" WHERE "event_occurrences"."schedulable_id" = ? AND "event_occurrences"."schedulable_type" = ? AND (event_occurrences.date >= ? AND schedulable_type = ?) ORDER BY date ASC [["schedulable_id", 1], ["schedulable_type", "Event"], [nil, "2025-09-22 05:44:02.965803"], [nil, "EventOccurrence"]] + EventOccurrence Create (0.1ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-09-22 06:44:02"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:44:02.974777"], ["updated_at", "2025-09-22 05:44:02.974777"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-09-29 06:44:02"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:44:02.976921"], ["updated_at", "2025-09-22 05:44:02.976921"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-10-06 06:44:02"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:44:02.978560"], ["updated_at", "2025-09-22 05:44:02.978560"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-10-13 06:44:02"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:44:02.978958"], ["updated_at", "2025-09-22 05:44:02.978958"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-10-20 06:44:02"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:44:02.981522"], ["updated_at", "2025-09-22 05:44:02.981522"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-10-27 07:44:02"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:44:02.982289"], ["updated_at", "2025-09-22 05:44:02.982289"]] + EventOccurrence Create (0.1ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-11-03 07:44:02"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:44:02.983221"], ["updated_at", "2025-09-22 05:44:02.983221"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-11-10 07:44:02"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:44:02.985028"], ["updated_at", "2025-09-22 05:44:02.985028"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-11-17 07:44:02"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:44:02.985300"], ["updated_at", "2025-09-22 05:44:02.985300"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-11-24 07:44:02"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:44:02.987123"], ["updated_at", "2025-09-22 05:44:02.987123"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-12-01 07:44:02"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:44:02.987794"], ["updated_at", "2025-09-22 05:44:02.987794"]] + EventOccurrence Create (0.1ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-12-08 07:44:02"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:44:02.991703"], ["updated_at", "2025-09-22 05:44:02.991703"]] + EventOccurrence Load (0.1ms) SELECT "event_occurrences".* FROM "event_occurrences" WHERE "event_occurrences"."schedulable_id" = ? AND "event_occurrences"."schedulable_type" = ? AND (event_occurrences.date >= ? AND schedulable_type = ?) ORDER BY date ASC [["schedulable_id", 1], ["schedulable_type", "Event"], [nil, "2025-09-22 05:44:02.998453"], [nil, "EventOccurrence"]] + TRANSACTION (0.0ms) RELEASE SAVEPOINT active_record_1 + TRANSACTION (0.3ms) rollback transaction + TRANSACTION (0.0ms) begin transaction +---------------------------------------------------- +SchedulableTest: test_schedule_generates_occurrences +---------------------------------------------------- + TRANSACTION (0.0ms) SAVEPOINT active_record_1 + Schedule Create (0.2ms) INSERT INTO "schedules" ("schedulable_id", "schedulable_type", "date", "time", "rule", "interval", "day", "day_of_week", "until", "count", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING "id" [["schedulable_id", nil], ["schedulable_type", nil], ["date", nil], ["time", "2000-01-01 07:44:03.006553"], ["rule", "weekly"], ["interval", nil], ["day", "---\n- monday\n"], ["day_of_week", nil], ["until", "2025-12-22 06:44:03.006575"], ["count", 10], ["created_at", "2025-09-22 05:44:03.009199"], ["updated_at", "2025-09-22 05:44:03.009199"]] + TRANSACTION (0.0ms) RELEASE SAVEPOINT active_record_1 + TRANSACTION (0.0ms) SAVEPOINT active_record_1 + Event Create (0.2ms) INSERT INTO "events" ("name", "created_at", "updated_at") VALUES (?, ?, ?) RETURNING "id" [["name", "My Event"], ["created_at", "2025-09-22 05:44:03.014445"], ["updated_at", "2025-09-22 05:44:03.014445"]] + Schedule Update (0.0ms) UPDATE "schedules" SET "schedulable_id" = ?, "schedulable_type" = ?, "updated_at" = ? WHERE "schedules"."id" = ? [["schedulable_id", 1], ["schedulable_type", "Event"], ["updated_at", "2025-09-22 05:44:03.018395"], ["id", 1]] + EventOccurrence Load (0.1ms) SELECT "event_occurrences".* FROM "event_occurrences" WHERE "event_occurrences"."schedulable_id" = ? AND "event_occurrences"."schedulable_type" = ? AND (event_occurrences.date >= ? AND schedulable_type = ?) ORDER BY date ASC [["schedulable_id", 1], ["schedulable_type", "Event"], [nil, "2025-09-22 05:44:03.027432"], [nil, "EventOccurrence"]] + EventOccurrence Create (0.1ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-09-22 06:44:03"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:44:03.031283"], ["updated_at", "2025-09-22 05:44:03.031283"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-09-29 06:44:03"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:44:03.032100"], ["updated_at", "2025-09-22 05:44:03.032100"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-10-06 06:44:03"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:44:03.032766"], ["updated_at", "2025-09-22 05:44:03.032766"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-10-13 06:44:03"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:44:03.033240"], ["updated_at", "2025-09-22 05:44:03.033240"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-10-20 06:44:03"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:44:03.033443"], ["updated_at", "2025-09-22 05:44:03.033443"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-10-27 07:44:03"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:44:03.036123"], ["updated_at", "2025-09-22 05:44:03.036123"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-11-03 07:44:03"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:44:03.037058"], ["updated_at", "2025-09-22 05:44:03.037058"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-11-10 07:44:03"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:44:03.037226"], ["updated_at", "2025-09-22 05:44:03.037226"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-11-17 07:44:03"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:44:03.037375"], ["updated_at", "2025-09-22 05:44:03.037375"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-11-24 07:44:03"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:44:03.037536"], ["updated_at", "2025-09-22 05:44:03.037536"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-12-01 07:44:03"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:44:03.037679"], ["updated_at", "2025-09-22 05:44:03.037679"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-12-08 07:44:03"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:44:03.037833"], ["updated_at", "2025-09-22 05:44:03.037833"]] + EventOccurrence Load (0.0ms) SELECT "event_occurrences".* FROM "event_occurrences" WHERE "event_occurrences"."schedulable_id" = ? AND "event_occurrences"."schedulable_type" = ? AND (event_occurrences.date >= ? AND schedulable_type = ?) ORDER BY date ASC [["schedulable_id", 1], ["schedulable_type", "Event"], [nil, "2025-09-22 05:44:03.039108"], [nil, "EventOccurrence"]] + TRANSACTION (0.0ms) RELEASE SAVEPOINT active_record_1 + TRANSACTION (0.4ms) rollback transaction + TRANSACTION (0.0ms) begin transaction +----------------------------------------------------- +SchedulableTest: test_schedule_has_correct_attributes +----------------------------------------------------- + TRANSACTION (0.0ms) SAVEPOINT active_record_1 + Schedule Create (0.1ms) INSERT INTO "schedules" ("schedulable_id", "schedulable_type", "date", "time", "rule", "interval", "day", "day_of_week", "until", "count", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING "id" [["schedulable_id", nil], ["schedulable_type", nil], ["date", nil], ["time", "2000-01-01 07:44:03.043544"], ["rule", "weekly"], ["interval", nil], ["day", "---\n- monday\n"], ["day_of_week", nil], ["until", "2025-12-22 06:44:03.043557"], ["count", 10], ["created_at", "2025-09-22 05:44:03.045273"], ["updated_at", "2025-09-22 05:44:03.045273"]] + TRANSACTION (0.0ms) RELEASE SAVEPOINT active_record_1 + TRANSACTION (0.0ms) SAVEPOINT active_record_1 + Event Create (0.1ms) INSERT INTO "events" ("name", "created_at", "updated_at") VALUES (?, ?, ?) RETURNING "id" [["name", "My Event"], ["created_at", "2025-09-22 05:44:03.046014"], ["updated_at", "2025-09-22 05:44:03.046014"]] + Schedule Update (0.0ms) UPDATE "schedules" SET "schedulable_id" = ?, "schedulable_type" = ?, "updated_at" = ? WHERE "schedules"."id" = ? [["schedulable_id", 1], ["schedulable_type", "Event"], ["updated_at", "2025-09-22 05:44:03.046644"], ["id", 1]] + EventOccurrence Load (0.1ms) SELECT "event_occurrences".* FROM "event_occurrences" WHERE "event_occurrences"."schedulable_id" = ? AND "event_occurrences"."schedulable_type" = ? AND (event_occurrences.date >= ? AND schedulable_type = ?) ORDER BY date ASC [["schedulable_id", 1], ["schedulable_type", "Event"], [nil, "2025-09-22 05:44:03.051275"], [nil, "EventOccurrence"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-09-22 06:44:03"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:44:03.051978"], ["updated_at", "2025-09-22 05:44:03.051978"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-09-29 06:44:03"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:44:03.052192"], ["updated_at", "2025-09-22 05:44:03.052192"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-10-06 06:44:03"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:44:03.052374"], ["updated_at", "2025-09-22 05:44:03.052374"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-10-13 06:44:03"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:44:03.052529"], ["updated_at", "2025-09-22 05:44:03.052529"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-10-20 06:44:03"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:44:03.052676"], ["updated_at", "2025-09-22 05:44:03.052676"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-10-27 07:44:03"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:44:03.052823"], ["updated_at", "2025-09-22 05:44:03.052823"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-11-03 07:44:03"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:44:03.052969"], ["updated_at", "2025-09-22 05:44:03.052969"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-11-10 07:44:03"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:44:03.053122"], ["updated_at", "2025-09-22 05:44:03.053122"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-11-17 07:44:03"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:44:03.053281"], ["updated_at", "2025-09-22 05:44:03.053281"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-11-24 07:44:03"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:44:03.053422"], ["updated_at", "2025-09-22 05:44:03.053422"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-12-01 07:44:03"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:44:03.053561"], ["updated_at", "2025-09-22 05:44:03.053561"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-12-08 07:44:03"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:44:03.053702"], ["updated_at", "2025-09-22 05:44:03.053702"]] + EventOccurrence Load (0.0ms) SELECT "event_occurrences".* FROM "event_occurrences" WHERE "event_occurrences"."schedulable_id" = ? AND "event_occurrences"."schedulable_type" = ? AND (event_occurrences.date >= ? AND schedulable_type = ?) ORDER BY date ASC [["schedulable_id", 1], ["schedulable_type", "Event"], [nil, "2025-09-22 05:44:03.054009"], [nil, "EventOccurrence"]] + TRANSACTION (0.0ms) RELEASE SAVEPOINT active_record_1 + TRANSACTION (0.0ms) rollback transaction + TRANSACTION (0.0ms) begin transaction +----------------------------------------------------------------- +SchedulableTest: test_schedule_serializes_day_attribute_correctly +----------------------------------------------------------------- + TRANSACTION (0.0ms) SAVEPOINT active_record_1 + Schedule Create (0.1ms) INSERT INTO "schedules" ("schedulable_id", "schedulable_type", "date", "time", "rule", "interval", "day", "day_of_week", "until", "count", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING "id" [["schedulable_id", nil], ["schedulable_type", nil], ["date", nil], ["time", "2000-01-01 07:44:03.057163"], ["rule", "weekly"], ["interval", nil], ["day", "---\n- monday\n"], ["day_of_week", nil], ["until", "2025-12-22 06:44:03.057547"], ["count", 10], ["created_at", "2025-09-22 05:44:03.059388"], ["updated_at", "2025-09-22 05:44:03.059388"]] + TRANSACTION (0.0ms) RELEASE SAVEPOINT active_record_1 + TRANSACTION (0.0ms) SAVEPOINT active_record_1 + Event Create (0.1ms) INSERT INTO "events" ("name", "created_at", "updated_at") VALUES (?, ?, ?) RETURNING "id" [["name", "My Event"], ["created_at", "2025-09-22 05:44:03.059928"], ["updated_at", "2025-09-22 05:44:03.059928"]] + Schedule Update (0.0ms) UPDATE "schedules" SET "schedulable_id" = ?, "schedulable_type" = ?, "updated_at" = ? WHERE "schedules"."id" = ? [["schedulable_id", 1], ["schedulable_type", "Event"], ["updated_at", "2025-09-22 05:44:03.060336"], ["id", 1]] + EventOccurrence Load (0.0ms) SELECT "event_occurrences".* FROM "event_occurrences" WHERE "event_occurrences"."schedulable_id" = ? AND "event_occurrences"."schedulable_type" = ? AND (event_occurrences.date >= ? AND schedulable_type = ?) ORDER BY date ASC [["schedulable_id", 1], ["schedulable_type", "Event"], [nil, "2025-09-22 05:44:03.065354"], [nil, "EventOccurrence"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-09-22 06:44:03"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:44:03.066743"], ["updated_at", "2025-09-22 05:44:03.066743"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-09-29 06:44:03"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:44:03.067019"], ["updated_at", "2025-09-22 05:44:03.067019"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-10-06 06:44:03"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:44:03.067175"], ["updated_at", "2025-09-22 05:44:03.067175"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-10-13 06:44:03"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:44:03.067322"], ["updated_at", "2025-09-22 05:44:03.067322"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-10-20 06:44:03"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:44:03.067465"], ["updated_at", "2025-09-22 05:44:03.067465"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-10-27 07:44:03"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:44:03.067619"], ["updated_at", "2025-09-22 05:44:03.067619"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-11-03 07:44:03"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:44:03.067761"], ["updated_at", "2025-09-22 05:44:03.067761"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-11-10 07:44:03"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:44:03.067914"], ["updated_at", "2025-09-22 05:44:03.067914"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-11-17 07:44:03"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:44:03.068060"], ["updated_at", "2025-09-22 05:44:03.068060"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-11-24 07:44:03"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:44:03.068208"], ["updated_at", "2025-09-22 05:44:03.068208"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-12-01 07:44:03"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:44:03.068343"], ["updated_at", "2025-09-22 05:44:03.068343"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-12-08 07:44:03"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:44:03.068493"], ["updated_at", "2025-09-22 05:44:03.068493"]] + EventOccurrence Load (0.0ms) SELECT "event_occurrences".* FROM "event_occurrences" WHERE "event_occurrences"."schedulable_id" = ? AND "event_occurrences"."schedulable_type" = ? AND (event_occurrences.date >= ? AND schedulable_type = ?) ORDER BY date ASC [["schedulable_id", 1], ["schedulable_type", "Event"], [nil, "2025-09-22 05:44:03.068620"], [nil, "EventOccurrence"]] + TRANSACTION (0.0ms) RELEASE SAVEPOINT active_record_1 + TRANSACTION (0.0ms) SAVEPOINT active_record_1 + Schedule Create (0.3ms) INSERT INTO "schedules" ("schedulable_id", "schedulable_type", "date", "time", "rule", "interval", "day", "day_of_week", "until", "count", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING "id" [["schedulable_id", nil], ["schedulable_type", nil], ["date", nil], ["time", "2000-01-01 07:44:03.070876"], ["rule", "weekly"], ["interval", nil], ["day", "---\n- monday\n- wednesday\n"], ["day_of_week", nil], ["until", "2025-12-22 06:44:03.070892"], ["count", 10], ["created_at", "2025-09-22 05:44:03.071277"], ["updated_at", "2025-09-22 05:44:03.071277"]] + TRANSACTION (0.0ms) RELEASE SAVEPOINT active_record_1 + Schedule Load (0.9ms) SELECT "schedules".* FROM "schedules" WHERE "schedules"."id" = ? LIMIT ? [["id", 2], ["LIMIT", 1]] + TRANSACTION (0.0ms) rollback transaction + TRANSACTION (0.0ms) begin transaction +------------------------------------------------------------------------- +SchedulableTest: test_schedule_serializes_day_of_week_attribute_correctly +------------------------------------------------------------------------- + TRANSACTION (0.0ms) SAVEPOINT active_record_1 + Schedule Create (0.1ms) INSERT INTO "schedules" ("schedulable_id", "schedulable_type", "date", "time", "rule", "interval", "day", "day_of_week", "until", "count", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING "id" [["schedulable_id", nil], ["schedulable_type", nil], ["date", nil], ["time", "2000-01-01 07:44:03.079784"], ["rule", "weekly"], ["interval", nil], ["day", "---\n- monday\n"], ["day_of_week", nil], ["until", "2025-12-22 06:44:03.079795"], ["count", 10], ["created_at", "2025-09-22 05:44:03.080246"], ["updated_at", "2025-09-22 05:44:03.080246"]] + TRANSACTION (0.0ms) RELEASE SAVEPOINT active_record_1 + TRANSACTION (0.0ms) SAVEPOINT active_record_1 + Event Create (0.1ms) INSERT INTO "events" ("name", "created_at", "updated_at") VALUES (?, ?, ?) RETURNING "id" [["name", "My Event"], ["created_at", "2025-09-22 05:44:03.085413"], ["updated_at", "2025-09-22 05:44:03.085413"]] + Schedule Update (0.0ms) UPDATE "schedules" SET "schedulable_id" = ?, "schedulable_type" = ?, "updated_at" = ? WHERE "schedules"."id" = ? [["schedulable_id", 1], ["schedulable_type", "Event"], ["updated_at", "2025-09-22 05:44:03.085894"], ["id", 1]] + EventOccurrence Load (0.1ms) SELECT "event_occurrences".* FROM "event_occurrences" WHERE "event_occurrences"."schedulable_id" = ? AND "event_occurrences"."schedulable_type" = ? AND (event_occurrences.date >= ? AND schedulable_type = ?) ORDER BY date ASC [["schedulable_id", 1], ["schedulable_type", "Event"], [nil, "2025-09-22 05:44:03.101885"], [nil, "EventOccurrence"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-09-22 06:44:03"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:44:03.102473"], ["updated_at", "2025-09-22 05:44:03.102473"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-09-29 06:44:03"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:44:03.102707"], ["updated_at", "2025-09-22 05:44:03.102707"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-10-06 06:44:03"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:44:03.103034"], ["updated_at", "2025-09-22 05:44:03.103034"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-10-13 06:44:03"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:44:03.103195"], ["updated_at", "2025-09-22 05:44:03.103195"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-10-20 06:44:03"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:44:03.103340"], ["updated_at", "2025-09-22 05:44:03.103340"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-10-27 07:44:03"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:44:03.103481"], ["updated_at", "2025-09-22 05:44:03.103481"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-11-03 07:44:03"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:44:03.103622"], ["updated_at", "2025-09-22 05:44:03.103622"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-11-10 07:44:03"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:44:03.103759"], ["updated_at", "2025-09-22 05:44:03.103759"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-11-17 07:44:03"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:44:03.103894"], ["updated_at", "2025-09-22 05:44:03.103894"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-11-24 07:44:03"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:44:03.104028"], ["updated_at", "2025-09-22 05:44:03.104028"]] + EventOccurrence Create (0.2ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-12-01 07:44:03"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:44:03.104162"], ["updated_at", "2025-09-22 05:44:03.104162"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-12-08 07:44:03"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:44:03.104453"], ["updated_at", "2025-09-22 05:44:03.104453"]] + EventOccurrence Load (0.0ms) SELECT "event_occurrences".* FROM "event_occurrences" WHERE "event_occurrences"."schedulable_id" = ? AND "event_occurrences"."schedulable_type" = ? AND (event_occurrences.date >= ? AND schedulable_type = ?) ORDER BY date ASC [["schedulable_id", 1], ["schedulable_type", "Event"], [nil, "2025-09-22 05:44:03.106053"], [nil, "EventOccurrence"]] + TRANSACTION (0.0ms) RELEASE SAVEPOINT active_record_1 + TRANSACTION (0.0ms) rollback transaction + ActiveRecord::InternalMetadata Load (0.2ms) SELECT * FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = ? ORDER BY "ar_internal_metadata"."key" ASC LIMIT 1 [[nil, "schema_sha1"]] + ActiveRecord::SchemaMigration Load (0.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC + TRANSACTION (0.1ms) begin transaction +---------------------------------------------------- +SchedulableTest: test_can_create_event_with_schedule +---------------------------------------------------- + TRANSACTION (0.0ms) SAVEPOINT active_record_1 + Schedule Create (0.4ms) INSERT INTO "schedules" ("schedulable_id", "schedulable_type", "date", "time", "rule", "interval", "day", "day_of_week", "until", "count", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING "id" [["schedulable_id", nil], ["schedulable_type", nil], ["date", nil], ["time", "2000-01-01 07:45:49.757254"], ["rule", "weekly"], ["interval", nil], ["day", "---\n- monday\n"], ["day_of_week", nil], ["until", "2025-12-22 06:45:49.757306"], ["count", 10], ["created_at", "2025-09-22 05:45:49.766218"], ["updated_at", "2025-09-22 05:45:49.766218"]] + TRANSACTION (0.5ms) RELEASE SAVEPOINT active_record_1 + TRANSACTION (0.0ms) SAVEPOINT active_record_1 + Event Create (0.3ms) INSERT INTO "events" ("name", "created_at", "updated_at") VALUES (?, ?, ?) RETURNING "id" [["name", "My Event"], ["created_at", "2025-09-22 05:45:49.776673"], ["updated_at", "2025-09-22 05:45:49.776673"]] + Schedule Update (0.3ms) UPDATE "schedules" SET "schedulable_id" = ?, "schedulable_type" = ?, "updated_at" = ? WHERE "schedules"."id" = ? [["schedulable_id", 1], ["schedulable_type", "Event"], ["updated_at", "2025-09-22 05:45:49.789561"], ["id", 1]] + EventOccurrence Load (0.6ms) SELECT "event_occurrences".* FROM "event_occurrences" WHERE "event_occurrences"."schedulable_id" = ? AND "event_occurrences"."schedulable_type" = ? AND (event_occurrences.date >= ? AND schedulable_type = ?) ORDER BY date ASC [["schedulable_id", 1], ["schedulable_type", "Event"], [nil, "2025-09-22 05:45:49.851580"], [nil, "EventOccurrence"]] + EventOccurrence Create (0.3ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-09-22 06:45:49"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:45:49.869192"], ["updated_at", "2025-09-22 05:45:49.869192"]] + EventOccurrence Create (0.2ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-09-29 06:45:49"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:45:49.872685"], ["updated_at", "2025-09-22 05:45:49.872685"]] + EventOccurrence Create (2.3ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-10-06 06:45:49"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:45:49.878726"], ["updated_at", "2025-09-22 05:45:49.878726"]] + EventOccurrence Create (0.1ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-10-13 06:45:49"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:45:49.884832"], ["updated_at", "2025-09-22 05:45:49.884832"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-10-20 06:45:49"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:45:49.887175"], ["updated_at", "2025-09-22 05:45:49.887175"]] + EventOccurrence Create (0.2ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-10-27 07:45:49"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:45:49.891470"], ["updated_at", "2025-09-22 05:45:49.891470"]] + EventOccurrence Create (0.2ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-11-03 07:45:49"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:45:49.894446"], ["updated_at", "2025-09-22 05:45:49.894446"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-11-10 07:45:49"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:45:49.896442"], ["updated_at", "2025-09-22 05:45:49.896442"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-11-17 07:45:49"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:45:49.898639"], ["updated_at", "2025-09-22 05:45:49.898639"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-11-24 07:45:49"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:45:49.899701"], ["updated_at", "2025-09-22 05:45:49.899701"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-12-01 07:45:49"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:45:49.900985"], ["updated_at", "2025-09-22 05:45:49.900985"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-12-08 07:45:49"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:45:49.901891"], ["updated_at", "2025-09-22 05:45:49.901891"]] + EventOccurrence Load (0.0ms) SELECT "event_occurrences".* FROM "event_occurrences" WHERE "event_occurrences"."schedulable_id" = ? AND "event_occurrences"."schedulable_type" = ? AND (event_occurrences.date >= ? AND schedulable_type = ?) ORDER BY date ASC [["schedulable_id", 1], ["schedulable_type", "Event"], [nil, "2025-09-22 05:45:49.902614"], [nil, "EventOccurrence"]] + TRANSACTION (0.5ms) RELEASE SAVEPOINT active_record_1 + TRANSACTION (0.5ms) rollback transaction + TRANSACTION (0.5ms) begin transaction +----------------------------------- +SchedulableTest: test_module_exists +----------------------------------- + TRANSACTION (0.1ms) SAVEPOINT active_record_1 + Schedule Create (0.3ms) INSERT INTO "schedules" ("schedulable_id", "schedulable_type", "date", "time", "rule", "interval", "day", "day_of_week", "until", "count", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING "id" [["schedulable_id", nil], ["schedulable_type", nil], ["date", nil], ["time", "2000-01-01 07:45:49.917491"], ["rule", "weekly"], ["interval", nil], ["day", "---\n- monday\n"], ["day_of_week", nil], ["until", "2025-12-22 06:45:49.918118"], ["count", 10], ["created_at", "2025-09-22 05:45:49.924255"], ["updated_at", "2025-09-22 05:45:49.924255"]] + TRANSACTION (0.0ms) RELEASE SAVEPOINT active_record_1 + TRANSACTION (0.0ms) SAVEPOINT active_record_1 + Event Create (0.2ms) INSERT INTO "events" ("name", "created_at", "updated_at") VALUES (?, ?, ?) RETURNING "id" [["name", "My Event"], ["created_at", "2025-09-22 05:45:49.933458"], ["updated_at", "2025-09-22 05:45:49.933458"]] + Schedule Update (0.0ms) UPDATE "schedules" SET "schedulable_id" = ?, "schedulable_type" = ?, "updated_at" = ? WHERE "schedules"."id" = ? [["schedulable_id", 1], ["schedulable_type", "Event"], ["updated_at", "2025-09-22 05:45:49.936817"], ["id", 1]] + EventOccurrence Load (0.1ms) SELECT "event_occurrences".* FROM "event_occurrences" WHERE "event_occurrences"."schedulable_id" = ? AND "event_occurrences"."schedulable_type" = ? AND (event_occurrences.date >= ? AND schedulable_type = ?) ORDER BY date ASC [["schedulable_id", 1], ["schedulable_type", "Event"], [nil, "2025-09-22 05:45:49.943802"], [nil, "EventOccurrence"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-09-22 06:45:49"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:45:49.951880"], ["updated_at", "2025-09-22 05:45:49.951880"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-09-29 06:45:49"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:45:49.953869"], ["updated_at", "2025-09-22 05:45:49.953869"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-10-06 06:45:49"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:45:49.955348"], ["updated_at", "2025-09-22 05:45:49.955348"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-10-13 06:45:49"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:45:49.955713"], ["updated_at", "2025-09-22 05:45:49.955713"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-10-20 06:45:49"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:45:49.958086"], ["updated_at", "2025-09-22 05:45:49.958086"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-10-27 07:45:49"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:45:49.958923"], ["updated_at", "2025-09-22 05:45:49.958923"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-11-03 07:45:49"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:45:49.959792"], ["updated_at", "2025-09-22 05:45:49.959792"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-11-10 07:45:49"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:45:49.961215"], ["updated_at", "2025-09-22 05:45:49.961215"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-11-17 07:45:49"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:45:49.961501"], ["updated_at", "2025-09-22 05:45:49.961501"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-11-24 07:45:49"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:45:49.963100"], ["updated_at", "2025-09-22 05:45:49.963100"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-12-01 07:45:49"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:45:49.963688"], ["updated_at", "2025-09-22 05:45:49.963688"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-12-08 07:45:49"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:45:49.967500"], ["updated_at", "2025-09-22 05:45:49.967500"]] + EventOccurrence Load (0.0ms) SELECT "event_occurrences".* FROM "event_occurrences" WHERE "event_occurrences"."schedulable_id" = ? AND "event_occurrences"."schedulable_type" = ? AND (event_occurrences.date >= ? AND schedulable_type = ?) ORDER BY date ASC [["schedulable_id", 1], ["schedulable_type", "Event"], [nil, "2025-09-22 05:45:49.973463"], [nil, "EventOccurrence"]] + TRANSACTION (0.0ms) RELEASE SAVEPOINT active_record_1 + TRANSACTION (0.3ms) rollback transaction + TRANSACTION (0.0ms) begin transaction +---------------------------------------------------- +SchedulableTest: test_schedule_generates_occurrences +---------------------------------------------------- + TRANSACTION (0.0ms) SAVEPOINT active_record_1 + Schedule Create (0.1ms) INSERT INTO "schedules" ("schedulable_id", "schedulable_type", "date", "time", "rule", "interval", "day", "day_of_week", "until", "count", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING "id" [["schedulable_id", nil], ["schedulable_type", nil], ["date", nil], ["time", "2000-01-01 07:45:49.980632"], ["rule", "weekly"], ["interval", nil], ["day", "---\n- monday\n"], ["day_of_week", nil], ["until", "2025-12-22 06:45:49.980647"], ["count", 10], ["created_at", "2025-09-22 05:45:49.983005"], ["updated_at", "2025-09-22 05:45:49.983005"]] + TRANSACTION (0.0ms) RELEASE SAVEPOINT active_record_1 + TRANSACTION (0.0ms) SAVEPOINT active_record_1 + Event Create (0.1ms) INSERT INTO "events" ("name", "created_at", "updated_at") VALUES (?, ?, ?) RETURNING "id" [["name", "My Event"], ["created_at", "2025-09-22 05:45:49.987845"], ["updated_at", "2025-09-22 05:45:49.987845"]] + Schedule Update (0.0ms) UPDATE "schedules" SET "schedulable_id" = ?, "schedulable_type" = ?, "updated_at" = ? WHERE "schedules"."id" = ? [["schedulable_id", 1], ["schedulable_type", "Event"], ["updated_at", "2025-09-22 05:45:49.991427"], ["id", 1]] + EventOccurrence Load (0.0ms) SELECT "event_occurrences".* FROM "event_occurrences" WHERE "event_occurrences"."schedulable_id" = ? AND "event_occurrences"."schedulable_type" = ? AND (event_occurrences.date >= ? AND schedulable_type = ?) ORDER BY date ASC [["schedulable_id", 1], ["schedulable_type", "Event"], [nil, "2025-09-22 05:45:50.000015"], [nil, "EventOccurrence"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-09-22 06:45:49"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:45:50.003499"], ["updated_at", "2025-09-22 05:45:50.003499"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-09-29 06:45:49"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:45:50.004142"], ["updated_at", "2025-09-22 05:45:50.004142"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-10-06 06:45:49"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:45:50.004715"], ["updated_at", "2025-09-22 05:45:50.004715"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-10-13 06:45:49"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:45:50.005186"], ["updated_at", "2025-09-22 05:45:50.005186"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-10-20 06:45:49"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:45:50.005359"], ["updated_at", "2025-09-22 05:45:50.005359"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-10-27 07:45:49"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:45:50.007903"], ["updated_at", "2025-09-22 05:45:50.007903"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-11-03 07:45:49"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:45:50.008841"], ["updated_at", "2025-09-22 05:45:50.008841"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-11-10 07:45:49"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:45:50.009025"], ["updated_at", "2025-09-22 05:45:50.009025"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-11-17 07:45:49"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:45:50.009201"], ["updated_at", "2025-09-22 05:45:50.009201"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-11-24 07:45:49"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:45:50.009350"], ["updated_at", "2025-09-22 05:45:50.009350"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-12-01 07:45:49"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:45:50.009509"], ["updated_at", "2025-09-22 05:45:50.009509"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-12-08 07:45:49"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:45:50.009652"], ["updated_at", "2025-09-22 05:45:50.009652"]] + EventOccurrence Load (0.0ms) SELECT "event_occurrences".* FROM "event_occurrences" WHERE "event_occurrences"."schedulable_id" = ? AND "event_occurrences"."schedulable_type" = ? AND (event_occurrences.date >= ? AND schedulable_type = ?) ORDER BY date ASC [["schedulable_id", 1], ["schedulable_type", "Event"], [nil, "2025-09-22 05:45:50.010844"], [nil, "EventOccurrence"]] + TRANSACTION (0.0ms) RELEASE SAVEPOINT active_record_1 + TRANSACTION (0.4ms) rollback transaction + TRANSACTION (0.0ms) begin transaction +----------------------------------------------------- +SchedulableTest: test_schedule_has_correct_attributes +----------------------------------------------------- + TRANSACTION (0.0ms) SAVEPOINT active_record_1 + Schedule Create (0.1ms) INSERT INTO "schedules" ("schedulable_id", "schedulable_type", "date", "time", "rule", "interval", "day", "day_of_week", "until", "count", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING "id" [["schedulable_id", nil], ["schedulable_type", nil], ["date", nil], ["time", "2000-01-01 07:45:50.014984"], ["rule", "weekly"], ["interval", nil], ["day", "---\n- monday\n"], ["day_of_week", nil], ["until", "2025-12-22 06:45:50.014994"], ["count", 10], ["created_at", "2025-09-22 05:45:50.016807"], ["updated_at", "2025-09-22 05:45:50.016807"]] + TRANSACTION (0.0ms) RELEASE SAVEPOINT active_record_1 + TRANSACTION (0.0ms) SAVEPOINT active_record_1 + Event Create (0.1ms) INSERT INTO "events" ("name", "created_at", "updated_at") VALUES (?, ?, ?) RETURNING "id" [["name", "My Event"], ["created_at", "2025-09-22 05:45:50.017501"], ["updated_at", "2025-09-22 05:45:50.017501"]] + Schedule Update (0.0ms) UPDATE "schedules" SET "schedulable_id" = ?, "schedulable_type" = ?, "updated_at" = ? WHERE "schedules"."id" = ? [["schedulable_id", 1], ["schedulable_type", "Event"], ["updated_at", "2025-09-22 05:45:50.018105"], ["id", 1]] + EventOccurrence Load (0.0ms) SELECT "event_occurrences".* FROM "event_occurrences" WHERE "event_occurrences"."schedulable_id" = ? AND "event_occurrences"."schedulable_type" = ? AND (event_occurrences.date >= ? AND schedulable_type = ?) ORDER BY date ASC [["schedulable_id", 1], ["schedulable_type", "Event"], [nil, "2025-09-22 05:45:50.022457"], [nil, "EventOccurrence"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-09-22 06:45:50"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:45:50.023022"], ["updated_at", "2025-09-22 05:45:50.023022"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-09-29 06:45:50"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:45:50.023216"], ["updated_at", "2025-09-22 05:45:50.023216"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-10-06 06:45:50"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:45:50.023378"], ["updated_at", "2025-09-22 05:45:50.023378"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-10-13 06:45:50"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:45:50.023527"], ["updated_at", "2025-09-22 05:45:50.023527"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-10-20 06:45:50"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:45:50.023674"], ["updated_at", "2025-09-22 05:45:50.023674"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-10-27 07:45:50"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:45:50.023820"], ["updated_at", "2025-09-22 05:45:50.023820"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-11-03 07:45:50"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:45:50.023959"], ["updated_at", "2025-09-22 05:45:50.023959"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-11-10 07:45:50"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:45:50.024120"], ["updated_at", "2025-09-22 05:45:50.024120"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-11-17 07:45:50"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:45:50.024257"], ["updated_at", "2025-09-22 05:45:50.024257"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-11-24 07:45:50"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:45:50.024397"], ["updated_at", "2025-09-22 05:45:50.024397"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-12-01 07:45:50"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:45:50.024533"], ["updated_at", "2025-09-22 05:45:50.024533"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-12-08 07:45:50"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:45:50.024668"], ["updated_at", "2025-09-22 05:45:50.024668"]] + EventOccurrence Load (0.0ms) SELECT "event_occurrences".* FROM "event_occurrences" WHERE "event_occurrences"."schedulable_id" = ? AND "event_occurrences"."schedulable_type" = ? AND (event_occurrences.date >= ? AND schedulable_type = ?) ORDER BY date ASC [["schedulable_id", 1], ["schedulable_type", "Event"], [nil, "2025-09-22 05:45:50.025013"], [nil, "EventOccurrence"]] + TRANSACTION (0.0ms) RELEASE SAVEPOINT active_record_1 + TRANSACTION (0.0ms) rollback transaction + TRANSACTION (0.0ms) begin transaction +----------------------------------------------------------------- +SchedulableTest: test_schedule_serializes_day_attribute_correctly +----------------------------------------------------------------- + TRANSACTION (0.0ms) SAVEPOINT active_record_1 + Schedule Create (0.1ms) INSERT INTO "schedules" ("schedulable_id", "schedulable_type", "date", "time", "rule", "interval", "day", "day_of_week", "until", "count", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING "id" [["schedulable_id", nil], ["schedulable_type", nil], ["date", nil], ["time", "2000-01-01 07:45:50.027846"], ["rule", "weekly"], ["interval", nil], ["day", "---\n- monday\n"], ["day_of_week", nil], ["until", "2025-12-22 06:45:50.028183"], ["count", 10], ["created_at", "2025-09-22 05:45:50.029886"], ["updated_at", "2025-09-22 05:45:50.029886"]] + TRANSACTION (0.0ms) RELEASE SAVEPOINT active_record_1 + TRANSACTION (0.0ms) SAVEPOINT active_record_1 + Event Create (0.1ms) INSERT INTO "events" ("name", "created_at", "updated_at") VALUES (?, ?, ?) RETURNING "id" [["name", "My Event"], ["created_at", "2025-09-22 05:45:50.030308"], ["updated_at", "2025-09-22 05:45:50.030308"]] + Schedule Update (0.0ms) UPDATE "schedules" SET "schedulable_id" = ?, "schedulable_type" = ?, "updated_at" = ? WHERE "schedules"."id" = ? [["schedulable_id", 1], ["schedulable_type", "Event"], ["updated_at", "2025-09-22 05:45:50.030725"], ["id", 1]] + EventOccurrence Load (0.0ms) SELECT "event_occurrences".* FROM "event_occurrences" WHERE "event_occurrences"."schedulable_id" = ? AND "event_occurrences"."schedulable_type" = ? AND (event_occurrences.date >= ? AND schedulable_type = ?) ORDER BY date ASC [["schedulable_id", 1], ["schedulable_type", "Event"], [nil, "2025-09-22 05:45:50.035808"], [nil, "EventOccurrence"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-09-22 06:45:50"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:45:50.037094"], ["updated_at", "2025-09-22 05:45:50.037094"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-09-29 06:45:50"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:45:50.037309"], ["updated_at", "2025-09-22 05:45:50.037309"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-10-06 06:45:50"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:45:50.037470"], ["updated_at", "2025-09-22 05:45:50.037470"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-10-13 06:45:50"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:45:50.037615"], ["updated_at", "2025-09-22 05:45:50.037615"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-10-20 06:45:50"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:45:50.037777"], ["updated_at", "2025-09-22 05:45:50.037777"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-10-27 07:45:50"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:45:50.037931"], ["updated_at", "2025-09-22 05:45:50.037931"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-11-03 07:45:50"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:45:50.038069"], ["updated_at", "2025-09-22 05:45:50.038069"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-11-10 07:45:50"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:45:50.038220"], ["updated_at", "2025-09-22 05:45:50.038220"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-11-17 07:45:50"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:45:50.038368"], ["updated_at", "2025-09-22 05:45:50.038368"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-11-24 07:45:50"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:45:50.038502"], ["updated_at", "2025-09-22 05:45:50.038502"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-12-01 07:45:50"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:45:50.038648"], ["updated_at", "2025-09-22 05:45:50.038648"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-12-08 07:45:50"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:45:50.038783"], ["updated_at", "2025-09-22 05:45:50.038783"]] + EventOccurrence Load (0.0ms) SELECT "event_occurrences".* FROM "event_occurrences" WHERE "event_occurrences"."schedulable_id" = ? AND "event_occurrences"."schedulable_type" = ? AND (event_occurrences.date >= ? AND schedulable_type = ?) ORDER BY date ASC [["schedulable_id", 1], ["schedulable_type", "Event"], [nil, "2025-09-22 05:45:50.038904"], [nil, "EventOccurrence"]] + TRANSACTION (0.0ms) RELEASE SAVEPOINT active_record_1 + TRANSACTION (0.0ms) SAVEPOINT active_record_1 + Schedule Create (0.4ms) INSERT INTO "schedules" ("schedulable_id", "schedulable_type", "date", "time", "rule", "interval", "day", "day_of_week", "until", "count", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING "id" [["schedulable_id", nil], ["schedulable_type", nil], ["date", nil], ["time", "2000-01-01 07:45:50.041125"], ["rule", "weekly"], ["interval", nil], ["day", "---\n- monday\n- wednesday\n"], ["day_of_week", nil], ["until", "2025-12-22 06:45:50.041136"], ["count", 10], ["created_at", "2025-09-22 05:45:50.041486"], ["updated_at", "2025-09-22 05:45:50.041486"]] + TRANSACTION (0.0ms) RELEASE SAVEPOINT active_record_1 + Schedule Load (0.9ms) SELECT "schedules".* FROM "schedules" WHERE "schedules"."id" = ? LIMIT ? [["id", 2], ["LIMIT", 1]] + TRANSACTION (0.0ms) rollback transaction + TRANSACTION (0.0ms) begin transaction +------------------------------------------------------------------------- +SchedulableTest: test_schedule_serializes_day_of_week_attribute_correctly +------------------------------------------------------------------------- + TRANSACTION (0.0ms) SAVEPOINT active_record_1 + Schedule Create (0.1ms) INSERT INTO "schedules" ("schedulable_id", "schedulable_type", "date", "time", "rule", "interval", "day", "day_of_week", "until", "count", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING "id" [["schedulable_id", nil], ["schedulable_type", nil], ["date", nil], ["time", "2000-01-01 07:45:50.049408"], ["rule", "weekly"], ["interval", nil], ["day", "---\n- monday\n"], ["day_of_week", nil], ["until", "2025-12-22 06:45:50.049417"], ["count", 10], ["created_at", "2025-09-22 05:45:50.049821"], ["updated_at", "2025-09-22 05:45:50.049821"]] + TRANSACTION (0.0ms) RELEASE SAVEPOINT active_record_1 + TRANSACTION (0.0ms) SAVEPOINT active_record_1 + Event Create (0.1ms) INSERT INTO "events" ("name", "created_at", "updated_at") VALUES (?, ?, ?) RETURNING "id" [["name", "My Event"], ["created_at", "2025-09-22 05:45:50.054875"], ["updated_at", "2025-09-22 05:45:50.054875"]] + Schedule Update (0.0ms) UPDATE "schedules" SET "schedulable_id" = ?, "schedulable_type" = ?, "updated_at" = ? WHERE "schedules"."id" = ? [["schedulable_id", 1], ["schedulable_type", "Event"], ["updated_at", "2025-09-22 05:45:50.055285"], ["id", 1]] + EventOccurrence Load (0.1ms) SELECT "event_occurrences".* FROM "event_occurrences" WHERE "event_occurrences"."schedulable_id" = ? AND "event_occurrences"."schedulable_type" = ? AND (event_occurrences.date >= ? AND schedulable_type = ?) ORDER BY date ASC [["schedulable_id", 1], ["schedulable_type", "Event"], [nil, "2025-09-22 05:45:50.070526"], [nil, "EventOccurrence"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-09-22 06:45:50"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:45:50.071098"], ["updated_at", "2025-09-22 05:45:50.071098"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-09-29 06:45:50"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:45:50.071325"], ["updated_at", "2025-09-22 05:45:50.071325"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-10-06 06:45:50"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:45:50.071636"], ["updated_at", "2025-09-22 05:45:50.071636"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-10-13 06:45:50"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:45:50.071792"], ["updated_at", "2025-09-22 05:45:50.071792"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-10-20 06:45:50"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:45:50.071937"], ["updated_at", "2025-09-22 05:45:50.071937"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-10-27 07:45:50"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:45:50.072077"], ["updated_at", "2025-09-22 05:45:50.072077"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-11-03 07:45:50"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:45:50.072215"], ["updated_at", "2025-09-22 05:45:50.072215"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-11-10 07:45:50"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:45:50.072350"], ["updated_at", "2025-09-22 05:45:50.072350"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-11-17 07:45:50"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:45:50.072483"], ["updated_at", "2025-09-22 05:45:50.072483"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-11-24 07:45:50"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:45:50.072617"], ["updated_at", "2025-09-22 05:45:50.072617"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-12-01 07:45:50"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:45:50.072893"], ["updated_at", "2025-09-22 05:45:50.072893"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-12-08 07:45:50"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:45:50.073033"], ["updated_at", "2025-09-22 05:45:50.073033"]] + EventOccurrence Load (0.0ms) SELECT "event_occurrences".* FROM "event_occurrences" WHERE "event_occurrences"."schedulable_id" = ? AND "event_occurrences"."schedulable_type" = ? AND (event_occurrences.date >= ? AND schedulable_type = ?) ORDER BY date ASC [["schedulable_id", 1], ["schedulable_type", "Event"], [nil, "2025-09-22 05:45:50.074734"], [nil, "EventOccurrence"]] + TRANSACTION (0.0ms) RELEASE SAVEPOINT active_record_1 + TRANSACTION (0.0ms) SAVEPOINT active_record_1 + Schedule Create (0.1ms) INSERT INTO "schedules" ("schedulable_id", "schedulable_type", "date", "time", "rule", "interval", "day", "day_of_week", "until", "count", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING "id" [["schedulable_id", nil], ["schedulable_type", nil], ["date", nil], ["time", "2000-01-01 07:45:50.075295"], ["rule", "monthly"], ["interval", nil], ["day", "---\n- monday\n"], ["day_of_week", "---\nmonday:\n- 1\n- 3\nwednesday:\n- 2\n- 4\n"], ["until", "2025-12-22 06:45:50.075310"], ["count", 10], ["created_at", "2025-09-22 05:45:50.081497"], ["updated_at", "2025-09-22 05:45:50.081497"]] + TRANSACTION (0.0ms) RELEASE SAVEPOINT active_record_1 + Schedule Load (0.1ms) SELECT "schedules".* FROM "schedules" WHERE "schedules"."id" = ? LIMIT ? [["id", 2], ["LIMIT", 1]] + TRANSACTION (0.0ms) rollback transaction + ActiveRecord::InternalMetadata Load (0.2ms) SELECT * FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = ? ORDER BY "ar_internal_metadata"."key" ASC LIMIT 1 [[nil, "schema_sha1"]] + ActiveRecord::SchemaMigration Load (0.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC + TRANSACTION (0.1ms) begin transaction +---------------------------------------------------- +SchedulableTest: test_can_create_event_with_schedule +---------------------------------------------------- + TRANSACTION (0.0ms) SAVEPOINT active_record_1 + Schedule Create (0.5ms) INSERT INTO "schedules" ("schedulable_id", "schedulable_type", "date", "time", "rule", "interval", "day", "day_of_week", "until", "count", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING "id" [["schedulable_id", nil], ["schedulable_type", nil], ["date", nil], ["time", "2000-01-01 07:47:07.258616"], ["rule", "weekly"], ["interval", nil], ["day", "---\n- monday\n"], ["day_of_week", nil], ["until", "2025-12-22 06:47:07.258665"], ["count", 10], ["created_at", "2025-09-22 05:47:07.268356"], ["updated_at", "2025-09-22 05:47:07.268356"]] + TRANSACTION (0.5ms) RELEASE SAVEPOINT active_record_1 + TRANSACTION (0.0ms) SAVEPOINT active_record_1 + Event Create (0.4ms) INSERT INTO "events" ("name", "created_at", "updated_at") VALUES (?, ?, ?) RETURNING "id" [["name", "My Event"], ["created_at", "2025-09-22 05:47:07.280403"], ["updated_at", "2025-09-22 05:47:07.280403"]] + Schedule Update (0.3ms) UPDATE "schedules" SET "schedulable_id" = ?, "schedulable_type" = ?, "updated_at" = ? WHERE "schedules"."id" = ? [["schedulable_id", 1], ["schedulable_type", "Event"], ["updated_at", "2025-09-22 05:47:07.293969"], ["id", 1]] + EventOccurrence Load (0.6ms) SELECT "event_occurrences".* FROM "event_occurrences" WHERE "event_occurrences"."schedulable_id" = ? AND "event_occurrences"."schedulable_type" = ? AND (event_occurrences.date >= ? AND schedulable_type = ?) ORDER BY date ASC [["schedulable_id", 1], ["schedulable_type", "Event"], [nil, "2025-09-22 05:47:07.356025"], [nil, "EventOccurrence"]] + EventOccurrence Create (0.3ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-09-22 06:47:07"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:07.362487"], ["updated_at", "2025-09-22 05:47:07.362487"]] + EventOccurrence Create (0.2ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-09-29 06:47:07"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:07.366793"], ["updated_at", "2025-09-22 05:47:07.366793"]] + EventOccurrence Create (2.5ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-10-06 06:47:07"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:07.373473"], ["updated_at", "2025-09-22 05:47:07.373473"]] + EventOccurrence Create (0.1ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-10-13 06:47:07"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:07.380292"], ["updated_at", "2025-09-22 05:47:07.380292"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-10-20 06:47:07"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:07.382794"], ["updated_at", "2025-09-22 05:47:07.382794"]] + EventOccurrence Create (0.3ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-10-27 07:47:07"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:07.387655"], ["updated_at", "2025-09-22 05:47:07.387655"]] + EventOccurrence Create (0.2ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-11-03 07:47:07"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:07.390461"], ["updated_at", "2025-09-22 05:47:07.390461"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-11-10 07:47:07"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:07.392658"], ["updated_at", "2025-09-22 05:47:07.392658"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-11-17 07:47:07"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:07.394890"], ["updated_at", "2025-09-22 05:47:07.394890"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-11-24 07:47:07"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:07.396009"], ["updated_at", "2025-09-22 05:47:07.396009"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-12-01 07:47:07"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:07.397170"], ["updated_at", "2025-09-22 05:47:07.397170"]] + EventOccurrence Create (0.1ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-12-08 07:47:07"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:07.398183"], ["updated_at", "2025-09-22 05:47:07.398183"]] + EventOccurrence Load (0.1ms) SELECT "event_occurrences".* FROM "event_occurrences" WHERE "event_occurrences"."schedulable_id" = ? AND "event_occurrences"."schedulable_type" = ? AND (event_occurrences.date >= ? AND schedulable_type = ?) ORDER BY date ASC [["schedulable_id", 1], ["schedulable_type", "Event"], [nil, "2025-09-22 05:47:07.398999"], [nil, "EventOccurrence"]] + TRANSACTION (0.5ms) RELEASE SAVEPOINT active_record_1 + TRANSACTION (0.6ms) rollback transaction + TRANSACTION (0.5ms) begin transaction +----------------------------------- +SchedulableTest: test_module_exists +----------------------------------- + TRANSACTION (0.1ms) SAVEPOINT active_record_1 + Schedule Create (0.3ms) INSERT INTO "schedules" ("schedulable_id", "schedulable_type", "date", "time", "rule", "interval", "day", "day_of_week", "until", "count", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING "id" [["schedulable_id", nil], ["schedulable_type", nil], ["date", nil], ["time", "2000-01-01 07:47:07.415473"], ["rule", "weekly"], ["interval", nil], ["day", "---\n- monday\n"], ["day_of_week", nil], ["until", "2025-12-22 06:47:07.416079"], ["count", 10], ["created_at", "2025-09-22 05:47:07.422473"], ["updated_at", "2025-09-22 05:47:07.422473"]] + TRANSACTION (0.0ms) RELEASE SAVEPOINT active_record_1 + TRANSACTION (0.0ms) SAVEPOINT active_record_1 + Event Create (0.2ms) INSERT INTO "events" ("name", "created_at", "updated_at") VALUES (?, ?, ?) RETURNING "id" [["name", "My Event"], ["created_at", "2025-09-22 05:47:07.432199"], ["updated_at", "2025-09-22 05:47:07.432199"]] + Schedule Update (0.0ms) UPDATE "schedules" SET "schedulable_id" = ?, "schedulable_type" = ?, "updated_at" = ? WHERE "schedules"."id" = ? [["schedulable_id", 1], ["schedulable_type", "Event"], ["updated_at", "2025-09-22 05:47:07.435532"], ["id", 1]] + EventOccurrence Load (0.0ms) SELECT "event_occurrences".* FROM "event_occurrences" WHERE "event_occurrences"."schedulable_id" = ? AND "event_occurrences"."schedulable_type" = ? AND (event_occurrences.date >= ? AND schedulable_type = ?) ORDER BY date ASC [["schedulable_id", 1], ["schedulable_type", "Event"], [nil, "2025-09-22 05:47:07.442246"], [nil, "EventOccurrence"]] + EventOccurrence Create (0.1ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-09-22 06:47:07"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:07.450832"], ["updated_at", "2025-09-22 05:47:07.450832"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-09-29 06:47:07"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:07.453102"], ["updated_at", "2025-09-22 05:47:07.453102"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-10-06 06:47:07"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:07.454844"], ["updated_at", "2025-09-22 05:47:07.454844"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-10-13 06:47:07"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:07.455328"], ["updated_at", "2025-09-22 05:47:07.455328"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-10-20 06:47:07"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:07.457833"], ["updated_at", "2025-09-22 05:47:07.457833"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-10-27 07:47:07"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:07.458695"], ["updated_at", "2025-09-22 05:47:07.458695"]] + EventOccurrence Create (0.1ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-11-03 07:47:07"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:07.459625"], ["updated_at", "2025-09-22 05:47:07.459625"]] + EventOccurrence Create (0.1ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-11-10 07:47:07"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:07.471313"], ["updated_at", "2025-09-22 05:47:07.471313"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-11-17 07:47:07"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:07.471890"], ["updated_at", "2025-09-22 05:47:07.471890"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-11-24 07:47:07"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:07.473999"], ["updated_at", "2025-09-22 05:47:07.473999"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-12-01 07:47:07"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:07.474792"], ["updated_at", "2025-09-22 05:47:07.474792"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-12-08 07:47:07"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:07.478416"], ["updated_at", "2025-09-22 05:47:07.478416"]] + EventOccurrence Load (0.1ms) SELECT "event_occurrences".* FROM "event_occurrences" WHERE "event_occurrences"."schedulable_id" = ? AND "event_occurrences"."schedulable_type" = ? AND (event_occurrences.date >= ? AND schedulable_type = ?) ORDER BY date ASC [["schedulable_id", 1], ["schedulable_type", "Event"], [nil, "2025-09-22 05:47:07.485002"], [nil, "EventOccurrence"]] + TRANSACTION (0.0ms) RELEASE SAVEPOINT active_record_1 + TRANSACTION (0.3ms) rollback transaction + TRANSACTION (0.0ms) begin transaction +---------------------------------------------------- +SchedulableTest: test_schedule_generates_occurrences +---------------------------------------------------- + TRANSACTION (0.0ms) SAVEPOINT active_record_1 + Schedule Create (0.2ms) INSERT INTO "schedules" ("schedulable_id", "schedulable_type", "date", "time", "rule", "interval", "day", "day_of_week", "until", "count", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING "id" [["schedulable_id", nil], ["schedulable_type", nil], ["date", nil], ["time", "2000-01-01 07:47:07.494022"], ["rule", "weekly"], ["interval", nil], ["day", "---\n- monday\n"], ["day_of_week", nil], ["until", "2025-12-22 06:47:07.494045"], ["count", 10], ["created_at", "2025-09-22 05:47:07.497022"], ["updated_at", "2025-09-22 05:47:07.497022"]] + TRANSACTION (0.0ms) RELEASE SAVEPOINT active_record_1 + TRANSACTION (0.0ms) SAVEPOINT active_record_1 + Event Create (0.1ms) INSERT INTO "events" ("name", "created_at", "updated_at") VALUES (?, ?, ?) RETURNING "id" [["name", "My Event"], ["created_at", "2025-09-22 05:47:07.503226"], ["updated_at", "2025-09-22 05:47:07.503226"]] + Schedule Update (0.0ms) UPDATE "schedules" SET "schedulable_id" = ?, "schedulable_type" = ?, "updated_at" = ? WHERE "schedules"."id" = ? [["schedulable_id", 1], ["schedulable_type", "Event"], ["updated_at", "2025-09-22 05:47:07.507092"], ["id", 1]] + EventOccurrence Load (0.1ms) SELECT "event_occurrences".* FROM "event_occurrences" WHERE "event_occurrences"."schedulable_id" = ? AND "event_occurrences"."schedulable_type" = ? AND (event_occurrences.date >= ? AND schedulable_type = ?) ORDER BY date ASC [["schedulable_id", 1], ["schedulable_type", "Event"], [nil, "2025-09-22 05:47:07.517621"], [nil, "EventOccurrence"]] + EventOccurrence Create (0.1ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-09-22 06:47:07"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:07.521961"], ["updated_at", "2025-09-22 05:47:07.521961"]] + EventOccurrence Create (0.1ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-09-29 06:47:07"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:07.522956"], ["updated_at", "2025-09-22 05:47:07.522956"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-10-06 06:47:07"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:07.523870"], ["updated_at", "2025-09-22 05:47:07.523870"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-10-13 06:47:07"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:07.524351"], ["updated_at", "2025-09-22 05:47:07.524351"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-10-20 06:47:07"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:07.524551"], ["updated_at", "2025-09-22 05:47:07.524551"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-10-27 07:47:07"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:07.527405"], ["updated_at", "2025-09-22 05:47:07.527405"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-11-03 07:47:07"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:07.528484"], ["updated_at", "2025-09-22 05:47:07.528484"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-11-10 07:47:07"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:07.528674"], ["updated_at", "2025-09-22 05:47:07.528674"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-11-17 07:47:07"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:07.528840"], ["updated_at", "2025-09-22 05:47:07.528840"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-11-24 07:47:07"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:07.528996"], ["updated_at", "2025-09-22 05:47:07.528996"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-12-01 07:47:07"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:07.529152"], ["updated_at", "2025-09-22 05:47:07.529152"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-12-08 07:47:07"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:07.529295"], ["updated_at", "2025-09-22 05:47:07.529295"]] + EventOccurrence Load (0.1ms) SELECT "event_occurrences".* FROM "event_occurrences" WHERE "event_occurrences"."schedulable_id" = ? AND "event_occurrences"."schedulable_type" = ? AND (event_occurrences.date >= ? AND schedulable_type = ?) ORDER BY date ASC [["schedulable_id", 1], ["schedulable_type", "Event"], [nil, "2025-09-22 05:47:07.530917"], [nil, "EventOccurrence"]] + TRANSACTION (0.0ms) RELEASE SAVEPOINT active_record_1 + TRANSACTION (0.4ms) rollback transaction + TRANSACTION (0.0ms) begin transaction +----------------------------------------------------- +SchedulableTest: test_schedule_has_correct_attributes +----------------------------------------------------- + TRANSACTION (0.0ms) SAVEPOINT active_record_1 + Schedule Create (0.1ms) INSERT INTO "schedules" ("schedulable_id", "schedulable_type", "date", "time", "rule", "interval", "day", "day_of_week", "until", "count", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING "id" [["schedulable_id", nil], ["schedulable_type", nil], ["date", nil], ["time", "2000-01-01 07:47:07.535969"], ["rule", "weekly"], ["interval", nil], ["day", "---\n- monday\n"], ["day_of_week", nil], ["until", "2025-12-22 06:47:07.535990"], ["count", 10], ["created_at", "2025-09-22 05:47:07.538057"], ["updated_at", "2025-09-22 05:47:07.538057"]] + TRANSACTION (0.0ms) RELEASE SAVEPOINT active_record_1 + TRANSACTION (0.0ms) SAVEPOINT active_record_1 + Event Create (0.1ms) INSERT INTO "events" ("name", "created_at", "updated_at") VALUES (?, ?, ?) RETURNING "id" [["name", "My Event"], ["created_at", "2025-09-22 05:47:07.538823"], ["updated_at", "2025-09-22 05:47:07.538823"]] + Schedule Update (0.0ms) UPDATE "schedules" SET "schedulable_id" = ?, "schedulable_type" = ?, "updated_at" = ? WHERE "schedules"."id" = ? [["schedulable_id", 1], ["schedulable_type", "Event"], ["updated_at", "2025-09-22 05:47:07.539572"], ["id", 1]] + EventOccurrence Load (0.1ms) SELECT "event_occurrences".* FROM "event_occurrences" WHERE "event_occurrences"."schedulable_id" = ? AND "event_occurrences"."schedulable_type" = ? AND (event_occurrences.date >= ? AND schedulable_type = ?) ORDER BY date ASC [["schedulable_id", 1], ["schedulable_type", "Event"], [nil, "2025-09-22 05:47:07.544030"], [nil, "EventOccurrence"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-09-22 06:47:07"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:07.545005"], ["updated_at", "2025-09-22 05:47:07.545005"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-09-29 06:47:07"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:07.545267"], ["updated_at", "2025-09-22 05:47:07.545267"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-10-06 06:47:07"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:07.545447"], ["updated_at", "2025-09-22 05:47:07.545447"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-10-13 06:47:07"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:07.545616"], ["updated_at", "2025-09-22 05:47:07.545616"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-10-20 06:47:07"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:07.545807"], ["updated_at", "2025-09-22 05:47:07.545807"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-10-27 07:47:07"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:07.545968"], ["updated_at", "2025-09-22 05:47:07.545968"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-11-03 07:47:07"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:07.546124"], ["updated_at", "2025-09-22 05:47:07.546124"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-11-10 07:47:07"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:07.546283"], ["updated_at", "2025-09-22 05:47:07.546283"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-11-17 07:47:07"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:07.546447"], ["updated_at", "2025-09-22 05:47:07.546447"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-11-24 07:47:07"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:07.546598"], ["updated_at", "2025-09-22 05:47:07.546598"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-12-01 07:47:07"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:07.546750"], ["updated_at", "2025-09-22 05:47:07.546750"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-12-08 07:47:07"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:07.546902"], ["updated_at", "2025-09-22 05:47:07.546902"]] + EventOccurrence Load (0.0ms) SELECT "event_occurrences".* FROM "event_occurrences" WHERE "event_occurrences"."schedulable_id" = ? AND "event_occurrences"."schedulable_type" = ? AND (event_occurrences.date >= ? AND schedulable_type = ?) ORDER BY date ASC [["schedulable_id", 1], ["schedulable_type", "Event"], [nil, "2025-09-22 05:47:07.547301"], [nil, "EventOccurrence"]] + TRANSACTION (0.0ms) RELEASE SAVEPOINT active_record_1 + TRANSACTION (0.0ms) rollback transaction + TRANSACTION (0.0ms) begin transaction +----------------------------------------------------------------- +SchedulableTest: test_schedule_serializes_day_attribute_correctly +----------------------------------------------------------------- + TRANSACTION (0.0ms) SAVEPOINT active_record_1 + Schedule Create (0.1ms) INSERT INTO "schedules" ("schedulable_id", "schedulable_type", "date", "time", "rule", "interval", "day", "day_of_week", "until", "count", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING "id" [["schedulable_id", nil], ["schedulable_type", nil], ["date", nil], ["time", "2000-01-01 07:47:07.550763"], ["rule", "weekly"], ["interval", nil], ["day", "---\n- monday\n"], ["day_of_week", nil], ["until", "2025-12-22 06:47:07.551111"], ["count", 10], ["created_at", "2025-09-22 05:47:07.552691"], ["updated_at", "2025-09-22 05:47:07.552691"]] + TRANSACTION (0.0ms) RELEASE SAVEPOINT active_record_1 + TRANSACTION (0.0ms) SAVEPOINT active_record_1 + Event Create (0.1ms) INSERT INTO "events" ("name", "created_at", "updated_at") VALUES (?, ?, ?) RETURNING "id" [["name", "My Event"], ["created_at", "2025-09-22 05:47:07.553121"], ["updated_at", "2025-09-22 05:47:07.553121"]] + Schedule Update (0.0ms) UPDATE "schedules" SET "schedulable_id" = ?, "schedulable_type" = ?, "updated_at" = ? WHERE "schedules"."id" = ? [["schedulable_id", 1], ["schedulable_type", "Event"], ["updated_at", "2025-09-22 05:47:07.553511"], ["id", 1]] + EventOccurrence Load (0.1ms) SELECT "event_occurrences".* FROM "event_occurrences" WHERE "event_occurrences"."schedulable_id" = ? AND "event_occurrences"."schedulable_type" = ? AND (event_occurrences.date >= ? AND schedulable_type = ?) ORDER BY date ASC [["schedulable_id", 1], ["schedulable_type", "Event"], [nil, "2025-09-22 05:47:07.558602"], [nil, "EventOccurrence"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-09-22 06:47:07"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:07.560079"], ["updated_at", "2025-09-22 05:47:07.560079"]] + EventOccurrence Create (0.1ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-09-29 06:47:07"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:07.560318"], ["updated_at", "2025-09-22 05:47:07.560318"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-10-06 06:47:07"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:07.568839"], ["updated_at", "2025-09-22 05:47:07.568839"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-10-13 06:47:07"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:07.569034"], ["updated_at", "2025-09-22 05:47:07.569034"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-10-20 06:47:07"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:07.569194"], ["updated_at", "2025-09-22 05:47:07.569194"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-10-27 07:47:07"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:07.569345"], ["updated_at", "2025-09-22 05:47:07.569345"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-11-03 07:47:07"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:07.569492"], ["updated_at", "2025-09-22 05:47:07.569492"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-11-10 07:47:07"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:07.569636"], ["updated_at", "2025-09-22 05:47:07.569636"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-11-17 07:47:07"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:07.569779"], ["updated_at", "2025-09-22 05:47:07.569779"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-11-24 07:47:07"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:07.570180"], ["updated_at", "2025-09-22 05:47:07.570180"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-12-01 07:47:07"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:07.570327"], ["updated_at", "2025-09-22 05:47:07.570327"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-12-08 07:47:07"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:07.570469"], ["updated_at", "2025-09-22 05:47:07.570469"]] + EventOccurrence Load (0.0ms) SELECT "event_occurrences".* FROM "event_occurrences" WHERE "event_occurrences"."schedulable_id" = ? AND "event_occurrences"."schedulable_type" = ? AND (event_occurrences.date >= ? AND schedulable_type = ?) ORDER BY date ASC [["schedulable_id", 1], ["schedulable_type", "Event"], [nil, "2025-09-22 05:47:07.570638"], [nil, "EventOccurrence"]] + TRANSACTION (0.0ms) RELEASE SAVEPOINT active_record_1 + TRANSACTION (0.0ms) SAVEPOINT active_record_1 + Schedule Create (0.3ms) INSERT INTO "schedules" ("schedulable_id", "schedulable_type", "date", "time", "rule", "interval", "day", "day_of_week", "until", "count", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING "id" [["schedulable_id", nil], ["schedulable_type", nil], ["date", nil], ["time", "2000-01-01 07:47:07.573048"], ["rule", "weekly"], ["interval", nil], ["day", "---\n- monday\n- wednesday\n"], ["day_of_week", nil], ["until", "2025-12-22 06:47:07.573061"], ["count", 10], ["created_at", "2025-09-22 05:47:07.573461"], ["updated_at", "2025-09-22 05:47:07.573461"]] + TRANSACTION (0.0ms) RELEASE SAVEPOINT active_record_1 + Schedule Load (1.1ms) SELECT "schedules".* FROM "schedules" WHERE "schedules"."id" = ? LIMIT ? [["id", 2], ["LIMIT", 1]] + TRANSACTION (0.0ms) rollback transaction + TRANSACTION (0.0ms) begin transaction +------------------------------------------------------------------------- +SchedulableTest: test_schedule_serializes_day_of_week_attribute_correctly +------------------------------------------------------------------------- + TRANSACTION (0.0ms) SAVEPOINT active_record_1 + Schedule Create (0.1ms) INSERT INTO "schedules" ("schedulable_id", "schedulable_type", "date", "time", "rule", "interval", "day", "day_of_week", "until", "count", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING "id" [["schedulable_id", nil], ["schedulable_type", nil], ["date", nil], ["time", "2000-01-01 07:47:07.583072"], ["rule", "weekly"], ["interval", nil], ["day", "---\n- monday\n"], ["day_of_week", nil], ["until", "2025-12-22 06:47:07.583086"], ["count", 10], ["created_at", "2025-09-22 05:47:07.583576"], ["updated_at", "2025-09-22 05:47:07.583576"]] + TRANSACTION (0.0ms) RELEASE SAVEPOINT active_record_1 + TRANSACTION (0.0ms) SAVEPOINT active_record_1 + Event Create (0.1ms) INSERT INTO "events" ("name", "created_at", "updated_at") VALUES (?, ?, ?) RETURNING "id" [["name", "My Event"], ["created_at", "2025-09-22 05:47:07.589140"], ["updated_at", "2025-09-22 05:47:07.589140"]] + Schedule Update (0.0ms) UPDATE "schedules" SET "schedulable_id" = ?, "schedulable_type" = ?, "updated_at" = ? WHERE "schedules"."id" = ? [["schedulable_id", 1], ["schedulable_type", "Event"], ["updated_at", "2025-09-22 05:47:07.589557"], ["id", 1]] + EventOccurrence Load (0.1ms) SELECT "event_occurrences".* FROM "event_occurrences" WHERE "event_occurrences"."schedulable_id" = ? AND "event_occurrences"."schedulable_type" = ? AND (event_occurrences.date >= ? AND schedulable_type = ?) ORDER BY date ASC [["schedulable_id", 1], ["schedulable_type", "Event"], [nil, "2025-09-22 05:47:07.597106"], [nil, "EventOccurrence"]] + EventOccurrence Create (0.1ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-09-22 06:47:07"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:07.597664"], ["updated_at", "2025-09-22 05:47:07.597664"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-09-29 06:47:07"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:07.597981"], ["updated_at", "2025-09-22 05:47:07.597981"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-10-06 06:47:07"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:07.598155"], ["updated_at", "2025-09-22 05:47:07.598155"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-10-13 06:47:07"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:07.598433"], ["updated_at", "2025-09-22 05:47:07.598433"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-10-20 06:47:07"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:07.598600"], ["updated_at", "2025-09-22 05:47:07.598600"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-10-27 07:47:07"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:07.598750"], ["updated_at", "2025-09-22 05:47:07.598750"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-11-03 07:47:07"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:07.598902"], ["updated_at", "2025-09-22 05:47:07.598902"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-11-10 07:47:07"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:07.599049"], ["updated_at", "2025-09-22 05:47:07.599049"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-11-17 07:47:07"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:07.599198"], ["updated_at", "2025-09-22 05:47:07.599198"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-11-24 07:47:07"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:07.599350"], ["updated_at", "2025-09-22 05:47:07.599350"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-12-01 07:47:07"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:07.599496"], ["updated_at", "2025-09-22 05:47:07.599496"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-12-08 07:47:07"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:07.599646"], ["updated_at", "2025-09-22 05:47:07.599646"]] + EventOccurrence Load (0.0ms) SELECT "event_occurrences".* FROM "event_occurrences" WHERE "event_occurrences"."schedulable_id" = ? AND "event_occurrences"."schedulable_type" = ? AND (event_occurrences.date >= ? AND schedulable_type = ?) ORDER BY date ASC [["schedulable_id", 1], ["schedulable_type", "Event"], [nil, "2025-09-22 05:47:07.601385"], [nil, "EventOccurrence"]] + TRANSACTION (0.0ms) RELEASE SAVEPOINT active_record_1 + TRANSACTION (0.0ms) SAVEPOINT active_record_1 + Schedule Create (0.1ms) INSERT INTO "schedules" ("schedulable_id", "schedulable_type", "date", "time", "rule", "interval", "day", "day_of_week", "until", "count", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING "id" [["schedulable_id", nil], ["schedulable_type", nil], ["date", nil], ["time", "2000-01-01 07:47:07.601892"], ["rule", "monthly"], ["interval", nil], ["day", "---\n- monday\n"], ["day_of_week", "---\nmonday:\n- 1\n- 3\nwednesday:\n- 2\n- 4\n"], ["until", "2025-12-22 06:47:07.601903"], ["count", 10], ["created_at", "2025-09-22 05:47:07.608795"], ["updated_at", "2025-09-22 05:47:07.608795"]] + TRANSACTION (0.0ms) RELEASE SAVEPOINT active_record_1 + Schedule Load (0.1ms) SELECT "schedules".* FROM "schedules" WHERE "schedules"."id" = ? LIMIT ? [["id", 2], ["LIMIT", 1]] + TRANSACTION (0.0ms) rollback transaction + ActiveRecord::InternalMetadata Load (0.4ms) SELECT * FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = ? ORDER BY "ar_internal_metadata"."key" ASC LIMIT 1 [[nil, "schema_sha1"]] + ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC + TRANSACTION (0.1ms) begin transaction +---------------------------------------------------- +SchedulableTest: test_can_create_event_with_schedule +---------------------------------------------------- + TRANSACTION (0.0ms) SAVEPOINT active_record_1 + Schedule Create (0.7ms) INSERT INTO "schedules" ("schedulable_id", "schedulable_type", "date", "time", "rule", "interval", "day", "day_of_week", "until", "count", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING "id" [["schedulable_id", nil], ["schedulable_type", nil], ["date", nil], ["time", "2000-01-01 07:47:40.999336"], ["rule", "weekly"], ["interval", nil], ["day", "---\n- monday\n"], ["day_of_week", nil], ["until", "2025-12-22 06:47:40.999401"], ["count", 10], ["created_at", "2025-09-22 05:47:41.011481"], ["updated_at", "2025-09-22 05:47:41.011481"]] + TRANSACTION (0.5ms) RELEASE SAVEPOINT active_record_1 + TRANSACTION (0.0ms) SAVEPOINT active_record_1 + Event Create (0.3ms) INSERT INTO "events" ("name", "created_at", "updated_at") VALUES (?, ?, ?) RETURNING "id" [["name", "My Event"], ["created_at", "2025-09-22 05:47:41.023369"], ["updated_at", "2025-09-22 05:47:41.023369"]] + Schedule Update (0.3ms) UPDATE "schedules" SET "schedulable_id" = ?, "schedulable_type" = ?, "updated_at" = ? WHERE "schedules"."id" = ? [["schedulable_id", 1], ["schedulable_type", "Event"], ["updated_at", "2025-09-22 05:47:41.035538"], ["id", 1]] + EventOccurrence Load (0.6ms) SELECT "event_occurrences".* FROM "event_occurrences" WHERE "event_occurrences"."schedulable_id" = ? AND "event_occurrences"."schedulable_type" = ? AND (event_occurrences.date >= ? AND schedulable_type = ?) ORDER BY date ASC [["schedulable_id", 1], ["schedulable_type", "Event"], [nil, "2025-09-22 05:47:41.096488"], [nil, "EventOccurrence"]] + EventOccurrence Create (0.3ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-09-22 06:47:40"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:41.112418"], ["updated_at", "2025-09-22 05:47:41.112418"]] + EventOccurrence Create (0.2ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-09-29 06:47:40"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:41.115803"], ["updated_at", "2025-09-22 05:47:41.115803"]] + EventOccurrence Create (2.2ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-10-06 06:47:40"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:41.121352"], ["updated_at", "2025-09-22 05:47:41.121352"]] + EventOccurrence Create (0.1ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-10-13 06:47:40"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:41.127049"], ["updated_at", "2025-09-22 05:47:41.127049"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-10-20 06:47:40"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:41.129352"], ["updated_at", "2025-09-22 05:47:41.129352"]] + EventOccurrence Create (0.3ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-10-27 07:47:40"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:41.133605"], ["updated_at", "2025-09-22 05:47:41.133605"]] + EventOccurrence Create (0.2ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-11-03 07:47:40"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:41.137169"], ["updated_at", "2025-09-22 05:47:41.137169"]] + EventOccurrence Create (0.1ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-11-10 07:47:40"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:41.139639"], ["updated_at", "2025-09-22 05:47:41.139639"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-11-17 07:47:40"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:41.142774"], ["updated_at", "2025-09-22 05:47:41.142774"]] + EventOccurrence Create (0.1ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-11-24 07:47:40"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:41.144293"], ["updated_at", "2025-09-22 05:47:41.144293"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-12-01 07:47:40"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:41.145727"], ["updated_at", "2025-09-22 05:47:41.145727"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-12-08 07:47:40"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:41.146728"], ["updated_at", "2025-09-22 05:47:41.146728"]] + EventOccurrence Load (0.0ms) SELECT "event_occurrences".* FROM "event_occurrences" WHERE "event_occurrences"."schedulable_id" = ? AND "event_occurrences"."schedulable_type" = ? AND (event_occurrences.date >= ? AND schedulable_type = ?) ORDER BY date ASC [["schedulable_id", 1], ["schedulable_type", "Event"], [nil, "2025-09-22 05:47:41.147520"], [nil, "EventOccurrence"]] + TRANSACTION (0.5ms) RELEASE SAVEPOINT active_record_1 + TRANSACTION (0.5ms) rollback transaction + TRANSACTION (0.6ms) begin transaction +----------------------------------- +SchedulableTest: test_module_exists +----------------------------------- + TRANSACTION (0.1ms) SAVEPOINT active_record_1 + Schedule Create (0.4ms) INSERT INTO "schedules" ("schedulable_id", "schedulable_type", "date", "time", "rule", "interval", "day", "day_of_week", "until", "count", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING "id" [["schedulable_id", nil], ["schedulable_type", nil], ["date", nil], ["time", "2000-01-01 07:47:41.163753"], ["rule", "weekly"], ["interval", nil], ["day", "---\n- monday\n"], ["day_of_week", nil], ["until", "2025-12-22 06:47:41.164332"], ["count", 10], ["created_at", "2025-09-22 05:47:41.170347"], ["updated_at", "2025-09-22 05:47:41.170347"]] + TRANSACTION (0.0ms) RELEASE SAVEPOINT active_record_1 + TRANSACTION (0.0ms) SAVEPOINT active_record_1 + Event Create (0.2ms) INSERT INTO "events" ("name", "created_at", "updated_at") VALUES (?, ?, ?) RETURNING "id" [["name", "My Event"], ["created_at", "2025-09-22 05:47:41.180899"], ["updated_at", "2025-09-22 05:47:41.180899"]] + Schedule Update (0.0ms) UPDATE "schedules" SET "schedulable_id" = ?, "schedulable_type" = ?, "updated_at" = ? WHERE "schedules"."id" = ? [["schedulable_id", 1], ["schedulable_type", "Event"], ["updated_at", "2025-09-22 05:47:41.184430"], ["id", 1]] + EventOccurrence Load (0.1ms) SELECT "event_occurrences".* FROM "event_occurrences" WHERE "event_occurrences"."schedulable_id" = ? AND "event_occurrences"."schedulable_type" = ? AND (event_occurrences.date >= ? AND schedulable_type = ?) ORDER BY date ASC [["schedulable_id", 1], ["schedulable_type", "Event"], [nil, "2025-09-22 05:47:41.191967"], [nil, "EventOccurrence"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-09-22 06:47:41"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:41.200237"], ["updated_at", "2025-09-22 05:47:41.200237"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-09-29 06:47:41"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:41.202078"], ["updated_at", "2025-09-22 05:47:41.202078"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-10-06 06:47:41"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:41.203587"], ["updated_at", "2025-09-22 05:47:41.203587"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-10-13 06:47:41"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:41.203957"], ["updated_at", "2025-09-22 05:47:41.203957"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-10-20 06:47:41"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:41.206283"], ["updated_at", "2025-09-22 05:47:41.206283"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-10-27 07:47:41"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:41.207035"], ["updated_at", "2025-09-22 05:47:41.207035"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-11-03 07:47:41"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:41.207955"], ["updated_at", "2025-09-22 05:47:41.207955"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-11-10 07:47:41"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:41.209396"], ["updated_at", "2025-09-22 05:47:41.209396"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-11-17 07:47:41"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:41.209739"], ["updated_at", "2025-09-22 05:47:41.209739"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-11-24 07:47:41"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:41.211282"], ["updated_at", "2025-09-22 05:47:41.211282"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-12-01 07:47:41"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:41.211865"], ["updated_at", "2025-09-22 05:47:41.211865"]] + EventOccurrence Create (0.1ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-12-08 07:47:41"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:41.215801"], ["updated_at", "2025-09-22 05:47:41.215801"]] + EventOccurrence Load (0.0ms) SELECT "event_occurrences".* FROM "event_occurrences" WHERE "event_occurrences"."schedulable_id" = ? AND "event_occurrences"."schedulable_type" = ? AND (event_occurrences.date >= ? AND schedulable_type = ?) ORDER BY date ASC [["schedulable_id", 1], ["schedulable_type", "Event"], [nil, "2025-09-22 05:47:41.221869"], [nil, "EventOccurrence"]] + TRANSACTION (0.0ms) RELEASE SAVEPOINT active_record_1 + TRANSACTION (0.3ms) rollback transaction + TRANSACTION (0.0ms) begin transaction +---------------------------------------------------- +SchedulableTest: test_schedule_generates_occurrences +---------------------------------------------------- + TRANSACTION (0.0ms) SAVEPOINT active_record_1 + Schedule Create (0.1ms) INSERT INTO "schedules" ("schedulable_id", "schedulable_type", "date", "time", "rule", "interval", "day", "day_of_week", "until", "count", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING "id" [["schedulable_id", nil], ["schedulable_type", nil], ["date", nil], ["time", "2000-01-01 07:47:41.228982"], ["rule", "weekly"], ["interval", nil], ["day", "---\n- monday\n"], ["day_of_week", nil], ["until", "2025-12-22 06:47:41.229004"], ["count", 10], ["created_at", "2025-09-22 05:47:41.231511"], ["updated_at", "2025-09-22 05:47:41.231511"]] + TRANSACTION (0.0ms) RELEASE SAVEPOINT active_record_1 + TRANSACTION (0.0ms) SAVEPOINT active_record_1 + Event Create (0.1ms) INSERT INTO "events" ("name", "created_at", "updated_at") VALUES (?, ?, ?) RETURNING "id" [["name", "My Event"], ["created_at", "2025-09-22 05:47:41.236473"], ["updated_at", "2025-09-22 05:47:41.236473"]] + Schedule Update (0.0ms) UPDATE "schedules" SET "schedulable_id" = ?, "schedulable_type" = ?, "updated_at" = ? WHERE "schedules"."id" = ? [["schedulable_id", 1], ["schedulable_type", "Event"], ["updated_at", "2025-09-22 05:47:41.240003"], ["id", 1]] + EventOccurrence Load (0.0ms) SELECT "event_occurrences".* FROM "event_occurrences" WHERE "event_occurrences"."schedulable_id" = ? AND "event_occurrences"."schedulable_type" = ? AND (event_occurrences.date >= ? AND schedulable_type = ?) ORDER BY date ASC [["schedulable_id", 1], ["schedulable_type", "Event"], [nil, "2025-09-22 05:47:41.248545"], [nil, "EventOccurrence"]] + EventOccurrence Create (0.1ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-09-22 06:47:41"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:41.252139"], ["updated_at", "2025-09-22 05:47:41.252139"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-09-29 06:47:41"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:41.253130"], ["updated_at", "2025-09-22 05:47:41.253130"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-10-06 06:47:41"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:41.253796"], ["updated_at", "2025-09-22 05:47:41.253796"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-10-13 06:47:41"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:41.254189"], ["updated_at", "2025-09-22 05:47:41.254189"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-10-20 06:47:41"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:41.254356"], ["updated_at", "2025-09-22 05:47:41.254356"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-10-27 07:47:41"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:41.256997"], ["updated_at", "2025-09-22 05:47:41.256997"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-11-03 07:47:41"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:41.257902"], ["updated_at", "2025-09-22 05:47:41.257902"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-11-10 07:47:41"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:41.258064"], ["updated_at", "2025-09-22 05:47:41.258064"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-11-17 07:47:41"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:41.258215"], ["updated_at", "2025-09-22 05:47:41.258215"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-11-24 07:47:41"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:41.258372"], ["updated_at", "2025-09-22 05:47:41.258372"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-12-01 07:47:41"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:41.258531"], ["updated_at", "2025-09-22 05:47:41.258531"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-12-08 07:47:41"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:41.258672"], ["updated_at", "2025-09-22 05:47:41.258672"]] + EventOccurrence Load (0.0ms) SELECT "event_occurrences".* FROM "event_occurrences" WHERE "event_occurrences"."schedulable_id" = ? AND "event_occurrences"."schedulable_type" = ? AND (event_occurrences.date >= ? AND schedulable_type = ?) ORDER BY date ASC [["schedulable_id", 1], ["schedulable_type", "Event"], [nil, "2025-09-22 05:47:41.259900"], [nil, "EventOccurrence"]] + TRANSACTION (0.0ms) RELEASE SAVEPOINT active_record_1 + TRANSACTION (0.5ms) rollback transaction + TRANSACTION (0.0ms) begin transaction +----------------------------------------------------- +SchedulableTest: test_schedule_has_correct_attributes +----------------------------------------------------- + TRANSACTION (0.0ms) SAVEPOINT active_record_1 + Schedule Create (0.1ms) INSERT INTO "schedules" ("schedulable_id", "schedulable_type", "date", "time", "rule", "interval", "day", "day_of_week", "until", "count", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING "id" [["schedulable_id", nil], ["schedulable_type", nil], ["date", nil], ["time", "2000-01-01 07:47:41.264529"], ["rule", "weekly"], ["interval", nil], ["day", "---\n- monday\n"], ["day_of_week", nil], ["until", "2025-12-22 06:47:41.264546"], ["count", 10], ["created_at", "2025-09-22 05:47:41.266511"], ["updated_at", "2025-09-22 05:47:41.266511"]] + TRANSACTION (0.0ms) RELEASE SAVEPOINT active_record_1 + TRANSACTION (0.0ms) SAVEPOINT active_record_1 + Event Create (0.1ms) INSERT INTO "events" ("name", "created_at", "updated_at") VALUES (?, ?, ?) RETURNING "id" [["name", "My Event"], ["created_at", "2025-09-22 05:47:41.267318"], ["updated_at", "2025-09-22 05:47:41.267318"]] + Schedule Update (0.0ms) UPDATE "schedules" SET "schedulable_id" = ?, "schedulable_type" = ?, "updated_at" = ? WHERE "schedules"."id" = ? [["schedulable_id", 1], ["schedulable_type", "Event"], ["updated_at", "2025-09-22 05:47:41.267994"], ["id", 1]] + EventOccurrence Load (0.0ms) SELECT "event_occurrences".* FROM "event_occurrences" WHERE "event_occurrences"."schedulable_id" = ? AND "event_occurrences"."schedulable_type" = ? AND (event_occurrences.date >= ? AND schedulable_type = ?) ORDER BY date ASC [["schedulable_id", 1], ["schedulable_type", "Event"], [nil, "2025-09-22 05:47:41.272593"], [nil, "EventOccurrence"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-09-22 06:47:41"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:41.273309"], ["updated_at", "2025-09-22 05:47:41.273309"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-09-29 06:47:41"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:41.273529"], ["updated_at", "2025-09-22 05:47:41.273529"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-10-06 06:47:41"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:41.273709"], ["updated_at", "2025-09-22 05:47:41.273709"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-10-13 06:47:41"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:41.273862"], ["updated_at", "2025-09-22 05:47:41.273862"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-10-20 06:47:41"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:41.274011"], ["updated_at", "2025-09-22 05:47:41.274011"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-10-27 07:47:41"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:41.274158"], ["updated_at", "2025-09-22 05:47:41.274158"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-11-03 07:47:41"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:41.274304"], ["updated_at", "2025-09-22 05:47:41.274304"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-11-10 07:47:41"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:41.274466"], ["updated_at", "2025-09-22 05:47:41.274466"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-11-17 07:47:41"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:41.274609"], ["updated_at", "2025-09-22 05:47:41.274609"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-11-24 07:47:41"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:41.274753"], ["updated_at", "2025-09-22 05:47:41.274753"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-12-01 07:47:41"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:41.274895"], ["updated_at", "2025-09-22 05:47:41.274895"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-12-08 07:47:41"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:41.275035"], ["updated_at", "2025-09-22 05:47:41.275035"]] + EventOccurrence Load (0.0ms) SELECT "event_occurrences".* FROM "event_occurrences" WHERE "event_occurrences"."schedulable_id" = ? AND "event_occurrences"."schedulable_type" = ? AND (event_occurrences.date >= ? AND schedulable_type = ?) ORDER BY date ASC [["schedulable_id", 1], ["schedulable_type", "Event"], [nil, "2025-09-22 05:47:41.275378"], [nil, "EventOccurrence"]] + TRANSACTION (0.0ms) RELEASE SAVEPOINT active_record_1 + TRANSACTION (0.0ms) rollback transaction + TRANSACTION (0.0ms) begin transaction +----------------------------------------------------------------- +SchedulableTest: test_schedule_serializes_day_attribute_correctly +----------------------------------------------------------------- + TRANSACTION (0.0ms) SAVEPOINT active_record_1 + Schedule Create (0.1ms) INSERT INTO "schedules" ("schedulable_id", "schedulable_type", "date", "time", "rule", "interval", "day", "day_of_week", "until", "count", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING "id" [["schedulable_id", nil], ["schedulable_type", nil], ["date", nil], ["time", "2000-01-01 07:47:41.278435"], ["rule", "weekly"], ["interval", nil], ["day", "---\n- monday\n"], ["day_of_week", nil], ["until", "2025-12-22 06:47:41.278784"], ["count", 10], ["created_at", "2025-09-22 05:47:41.280618"], ["updated_at", "2025-09-22 05:47:41.280618"]] + TRANSACTION (0.0ms) RELEASE SAVEPOINT active_record_1 + TRANSACTION (0.0ms) SAVEPOINT active_record_1 + Event Create (0.1ms) INSERT INTO "events" ("name", "created_at", "updated_at") VALUES (?, ?, ?) RETURNING "id" [["name", "My Event"], ["created_at", "2025-09-22 05:47:41.281151"], ["updated_at", "2025-09-22 05:47:41.281151"]] + Schedule Update (0.0ms) UPDATE "schedules" SET "schedulable_id" = ?, "schedulable_type" = ?, "updated_at" = ? WHERE "schedules"."id" = ? [["schedulable_id", 1], ["schedulable_type", "Event"], ["updated_at", "2025-09-22 05:47:41.281582"], ["id", 1]] + EventOccurrence Load (0.0ms) SELECT "event_occurrences".* FROM "event_occurrences" WHERE "event_occurrences"."schedulable_id" = ? AND "event_occurrences"."schedulable_type" = ? AND (event_occurrences.date >= ? AND schedulable_type = ?) ORDER BY date ASC [["schedulable_id", 1], ["schedulable_type", "Event"], [nil, "2025-09-22 05:47:41.286570"], [nil, "EventOccurrence"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-09-22 06:47:41"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:41.288012"], ["updated_at", "2025-09-22 05:47:41.288012"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-09-29 06:47:41"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:41.288203"], ["updated_at", "2025-09-22 05:47:41.288203"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-10-06 06:47:41"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:41.288363"], ["updated_at", "2025-09-22 05:47:41.288363"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-10-13 06:47:41"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:41.288511"], ["updated_at", "2025-09-22 05:47:41.288511"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-10-20 06:47:41"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:41.288656"], ["updated_at", "2025-09-22 05:47:41.288656"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-10-27 07:47:41"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:41.288812"], ["updated_at", "2025-09-22 05:47:41.288812"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-11-03 07:47:41"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:41.288960"], ["updated_at", "2025-09-22 05:47:41.288960"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-11-10 07:47:41"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:41.289109"], ["updated_at", "2025-09-22 05:47:41.289109"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-11-17 07:47:41"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:41.289258"], ["updated_at", "2025-09-22 05:47:41.289258"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-11-24 07:47:41"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:41.289395"], ["updated_at", "2025-09-22 05:47:41.289395"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-12-01 07:47:41"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:41.289541"], ["updated_at", "2025-09-22 05:47:41.289541"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-12-08 07:47:41"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:41.289677"], ["updated_at", "2025-09-22 05:47:41.289677"]] + EventOccurrence Load (0.0ms) SELECT "event_occurrences".* FROM "event_occurrences" WHERE "event_occurrences"."schedulable_id" = ? AND "event_occurrences"."schedulable_type" = ? AND (event_occurrences.date >= ? AND schedulable_type = ?) ORDER BY date ASC [["schedulable_id", 1], ["schedulable_type", "Event"], [nil, "2025-09-22 05:47:41.289799"], [nil, "EventOccurrence"]] + TRANSACTION (0.0ms) RELEASE SAVEPOINT active_record_1 + TRANSACTION (0.0ms) SAVEPOINT active_record_1 + Schedule Create (0.3ms) INSERT INTO "schedules" ("schedulable_id", "schedulable_type", "date", "time", "rule", "interval", "day", "day_of_week", "until", "count", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING "id" [["schedulable_id", nil], ["schedulable_type", nil], ["date", nil], ["time", "2000-01-01 07:47:41.291994"], ["rule", "weekly"], ["interval", nil], ["day", "---\n- monday\n- wednesday\n"], ["day_of_week", nil], ["until", "2025-12-22 06:47:41.292006"], ["count", 10], ["created_at", "2025-09-22 05:47:41.292322"], ["updated_at", "2025-09-22 05:47:41.292322"]] + TRANSACTION (0.0ms) RELEASE SAVEPOINT active_record_1 + Schedule Load (1.0ms) SELECT "schedules".* FROM "schedules" WHERE "schedules"."id" = ? LIMIT ? [["id", 2], ["LIMIT", 1]] + TRANSACTION (0.0ms) rollback transaction + TRANSACTION (0.0ms) begin transaction +------------------------------------------------------------------------- +SchedulableTest: test_schedule_serializes_day_of_week_attribute_correctly +------------------------------------------------------------------------- + TRANSACTION (0.0ms) SAVEPOINT active_record_1 + Schedule Create (0.1ms) INSERT INTO "schedules" ("schedulable_id", "schedulable_type", "date", "time", "rule", "interval", "day", "day_of_week", "until", "count", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING "id" [["schedulable_id", nil], ["schedulable_type", nil], ["date", nil], ["time", "2000-01-01 07:47:41.300483"], ["rule", "weekly"], ["interval", nil], ["day", "---\n- monday\n"], ["day_of_week", nil], ["until", "2025-12-22 06:47:41.300492"], ["count", 10], ["created_at", "2025-09-22 05:47:41.300884"], ["updated_at", "2025-09-22 05:47:41.300884"]] + TRANSACTION (0.0ms) RELEASE SAVEPOINT active_record_1 + TRANSACTION (0.0ms) SAVEPOINT active_record_1 + Event Create (0.1ms) INSERT INTO "events" ("name", "created_at", "updated_at") VALUES (?, ?, ?) RETURNING "id" [["name", "My Event"], ["created_at", "2025-09-22 05:47:41.305754"], ["updated_at", "2025-09-22 05:47:41.305754"]] + Schedule Update (0.0ms) UPDATE "schedules" SET "schedulable_id" = ?, "schedulable_type" = ?, "updated_at" = ? WHERE "schedules"."id" = ? [["schedulable_id", 1], ["schedulable_type", "Event"], ["updated_at", "2025-09-22 05:47:41.306091"], ["id", 1]] + EventOccurrence Load (0.1ms) SELECT "event_occurrences".* FROM "event_occurrences" WHERE "event_occurrences"."schedulable_id" = ? AND "event_occurrences"."schedulable_type" = ? AND (event_occurrences.date >= ? AND schedulable_type = ?) ORDER BY date ASC [["schedulable_id", 1], ["schedulable_type", "Event"], [nil, "2025-09-22 05:47:41.321689"], [nil, "EventOccurrence"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-09-22 06:47:41"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:41.322258"], ["updated_at", "2025-09-22 05:47:41.322258"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-09-29 06:47:41"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:41.322647"], ["updated_at", "2025-09-22 05:47:41.322647"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-10-06 06:47:41"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:41.322814"], ["updated_at", "2025-09-22 05:47:41.322814"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-10-13 06:47:41"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:41.322964"], ["updated_at", "2025-09-22 05:47:41.322964"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-10-20 06:47:41"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:41.323107"], ["updated_at", "2025-09-22 05:47:41.323107"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-10-27 07:47:41"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:41.323248"], ["updated_at", "2025-09-22 05:47:41.323248"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-11-03 07:47:41"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:41.323386"], ["updated_at", "2025-09-22 05:47:41.323386"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-11-10 07:47:41"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:41.323521"], ["updated_at", "2025-09-22 05:47:41.323521"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-11-17 07:47:41"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:41.323656"], ["updated_at", "2025-09-22 05:47:41.323656"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-11-24 07:47:41"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:41.323954"], ["updated_at", "2025-09-22 05:47:41.323954"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-12-01 07:47:41"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:41.324092"], ["updated_at", "2025-09-22 05:47:41.324092"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-12-08 07:47:41"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:47:41.324226"], ["updated_at", "2025-09-22 05:47:41.324226"]] + EventOccurrence Load (0.0ms) SELECT "event_occurrences".* FROM "event_occurrences" WHERE "event_occurrences"."schedulable_id" = ? AND "event_occurrences"."schedulable_type" = ? AND (event_occurrences.date >= ? AND schedulable_type = ?) ORDER BY date ASC [["schedulable_id", 1], ["schedulable_type", "Event"], [nil, "2025-09-22 05:47:41.325783"], [nil, "EventOccurrence"]] + TRANSACTION (0.0ms) RELEASE SAVEPOINT active_record_1 + TRANSACTION (0.0ms) SAVEPOINT active_record_1 + Schedule Create (0.1ms) INSERT INTO "schedules" ("schedulable_id", "schedulable_type", "date", "time", "rule", "interval", "day", "day_of_week", "until", "count", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING "id" [["schedulable_id", nil], ["schedulable_type", nil], ["date", nil], ["time", "2000-01-01 07:47:41.326244"], ["rule", "monthly"], ["interval", nil], ["day", "---\n- monday\n"], ["day_of_week", "---\nmonday:\n- 1\n- 3\nwednesday:\n- 2\n- 4\n"], ["until", "2025-12-22 06:47:41.326259"], ["count", 10], ["created_at", "2025-09-22 05:47:41.332584"], ["updated_at", "2025-09-22 05:47:41.332584"]] + TRANSACTION (0.0ms) RELEASE SAVEPOINT active_record_1 + Schedule Load (0.1ms) SELECT "schedules".* FROM "schedules" WHERE "schedules"."id" = ? LIMIT ? [["id", 2], ["LIMIT", 1]] + TRANSACTION (0.0ms) rollback transaction + ActiveRecord::InternalMetadata Load (0.2ms) SELECT * FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = ? ORDER BY "ar_internal_metadata"."key" ASC LIMIT 1 [[nil, "schema_sha1"]] + ActiveRecord::SchemaMigration Load (0.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC + TRANSACTION (0.1ms) begin transaction +---------------------------------------------------- +SchedulableTest: test_can_create_event_with_schedule +---------------------------------------------------- + TRANSACTION (0.0ms) SAVEPOINT active_record_1 + Schedule Create (0.5ms) INSERT INTO "schedules" ("schedulable_id", "schedulable_type", "date", "time", "rule", "interval", "day", "day_of_week", "until", "count", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING "id" [["schedulable_id", nil], ["schedulable_type", nil], ["date", nil], ["time", "2000-01-01 07:48:19.773018"], ["rule", "weekly"], ["interval", nil], ["day", "---\n- monday\n"], ["day_of_week", nil], ["until", "2025-12-22 06:48:19.773067"], ["count", 10], ["created_at", "2025-09-22 05:48:19.782691"], ["updated_at", "2025-09-22 05:48:19.782691"]] + TRANSACTION (0.7ms) RELEASE SAVEPOINT active_record_1 + TRANSACTION (0.0ms) SAVEPOINT active_record_1 + Event Create (0.4ms) INSERT INTO "events" ("name", "created_at", "updated_at") VALUES (?, ?, ?) RETURNING "id" [["name", "My Event"], ["created_at", "2025-09-22 05:48:19.794997"], ["updated_at", "2025-09-22 05:48:19.794997"]] + Schedule Update (0.3ms) UPDATE "schedules" SET "schedulable_id" = ?, "schedulable_type" = ?, "updated_at" = ? WHERE "schedules"."id" = ? [["schedulable_id", 1], ["schedulable_type", "Event"], ["updated_at", "2025-09-22 05:48:19.808773"], ["id", 1]] + EventOccurrence Load (0.6ms) SELECT "event_occurrences".* FROM "event_occurrences" WHERE "event_occurrences"."schedulable_id" = ? AND "event_occurrences"."schedulable_type" = ? AND (event_occurrences.date >= ? AND schedulable_type = ?) ORDER BY date ASC [["schedulable_id", 1], ["schedulable_type", "Event"], [nil, "2025-09-22 05:48:19.873326"], [nil, "EventOccurrence"]] + EventOccurrence Create (0.3ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-09-22 06:48:19"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:48:19.892516"], ["updated_at", "2025-09-22 05:48:19.892516"]] + EventOccurrence Create (0.3ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-09-29 06:48:19"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:48:19.896822"], ["updated_at", "2025-09-22 05:48:19.896822"]] + EventOccurrence Create (2.3ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-10-06 06:48:19"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:48:19.903902"], ["updated_at", "2025-09-22 05:48:19.903902"]] + EventOccurrence Create (0.1ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-10-13 06:48:19"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:48:19.910604"], ["updated_at", "2025-09-22 05:48:19.910604"]] + EventOccurrence Create (0.1ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-10-20 06:48:19"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:48:19.913310"], ["updated_at", "2025-09-22 05:48:19.913310"]] + EventOccurrence Create (0.3ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-10-27 07:48:19"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:48:19.918491"], ["updated_at", "2025-09-22 05:48:19.918491"]] + EventOccurrence Create (0.2ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-11-03 07:48:19"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:48:19.922267"], ["updated_at", "2025-09-22 05:48:19.922267"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-11-10 07:48:19"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:48:19.924760"], ["updated_at", "2025-09-22 05:48:19.924760"]] + EventOccurrence Create (0.1ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-11-17 07:48:19"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:48:19.927359"], ["updated_at", "2025-09-22 05:48:19.927359"]] + EventOccurrence Create (0.2ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-11-24 07:48:19"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:48:19.928953"], ["updated_at", "2025-09-22 05:48:19.928953"]] + EventOccurrence Create (0.1ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-12-01 07:48:19"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:48:19.930578"], ["updated_at", "2025-09-22 05:48:19.930578"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-12-08 07:48:19"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:48:19.931666"], ["updated_at", "2025-09-22 05:48:19.931666"]] + EventOccurrence Load (0.1ms) SELECT "event_occurrences".* FROM "event_occurrences" WHERE "event_occurrences"."schedulable_id" = ? AND "event_occurrences"."schedulable_type" = ? AND (event_occurrences.date >= ? AND schedulable_type = ?) ORDER BY date ASC [["schedulable_id", 1], ["schedulable_type", "Event"], [nil, "2025-09-22 05:48:19.932503"], [nil, "EventOccurrence"]] + TRANSACTION (0.5ms) RELEASE SAVEPOINT active_record_1 + TRANSACTION (0.6ms) rollback transaction + TRANSACTION (0.7ms) begin transaction +----------------------------------- +SchedulableTest: test_module_exists +----------------------------------- + TRANSACTION (0.1ms) SAVEPOINT active_record_1 + Schedule Create (0.4ms) INSERT INTO "schedules" ("schedulable_id", "schedulable_type", "date", "time", "rule", "interval", "day", "day_of_week", "until", "count", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING "id" [["schedulable_id", nil], ["schedulable_type", nil], ["date", nil], ["time", "2000-01-01 07:48:19.948634"], ["rule", "weekly"], ["interval", nil], ["day", "---\n- monday\n"], ["day_of_week", nil], ["until", "2025-12-22 06:48:19.949213"], ["count", 10], ["created_at", "2025-09-22 05:48:19.955543"], ["updated_at", "2025-09-22 05:48:19.955543"]] + TRANSACTION (0.0ms) RELEASE SAVEPOINT active_record_1 + TRANSACTION (0.0ms) SAVEPOINT active_record_1 + Event Create (0.2ms) INSERT INTO "events" ("name", "created_at", "updated_at") VALUES (?, ?, ?) RETURNING "id" [["name", "My Event"], ["created_at", "2025-09-22 05:48:19.966252"], ["updated_at", "2025-09-22 05:48:19.966252"]] + Schedule Update (0.0ms) UPDATE "schedules" SET "schedulable_id" = ?, "schedulable_type" = ?, "updated_at" = ? WHERE "schedules"."id" = ? [["schedulable_id", 1], ["schedulable_type", "Event"], ["updated_at", "2025-09-22 05:48:19.969764"], ["id", 1]] + EventOccurrence Load (0.1ms) SELECT "event_occurrences".* FROM "event_occurrences" WHERE "event_occurrences"."schedulable_id" = ? AND "event_occurrences"."schedulable_type" = ? AND (event_occurrences.date >= ? AND schedulable_type = ?) ORDER BY date ASC [["schedulable_id", 1], ["schedulable_type", "Event"], [nil, "2025-09-22 05:48:19.978164"], [nil, "EventOccurrence"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-09-22 06:48:19"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:48:19.987114"], ["updated_at", "2025-09-22 05:48:19.987114"]] + EventOccurrence Create (0.1ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-09-29 06:48:19"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:48:19.989047"], ["updated_at", "2025-09-22 05:48:19.989047"]] + EventOccurrence Create (0.1ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-10-06 06:48:19"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:48:19.990889"], ["updated_at", "2025-09-22 05:48:19.990889"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-10-13 06:48:19"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:48:19.991474"], ["updated_at", "2025-09-22 05:48:19.991474"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-10-20 06:48:19"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:48:19.993890"], ["updated_at", "2025-09-22 05:48:19.993890"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-10-27 07:48:19"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:48:19.994671"], ["updated_at", "2025-09-22 05:48:19.994671"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-11-03 07:48:19"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:48:19.995544"], ["updated_at", "2025-09-22 05:48:19.995544"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-11-10 07:48:19"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:48:19.997015"], ["updated_at", "2025-09-22 05:48:19.997015"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-11-17 07:48:19"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:48:19.997266"], ["updated_at", "2025-09-22 05:48:19.997266"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-11-24 07:48:19"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:48:19.998950"], ["updated_at", "2025-09-22 05:48:19.998950"]] + EventOccurrence Create (0.1ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-12-01 07:48:19"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:48:19.999797"], ["updated_at", "2025-09-22 05:48:19.999797"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-12-08 07:48:19"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:48:20.003955"], ["updated_at", "2025-09-22 05:48:20.003955"]] + EventOccurrence Load (0.1ms) SELECT "event_occurrences".* FROM "event_occurrences" WHERE "event_occurrences"."schedulable_id" = ? AND "event_occurrences"."schedulable_type" = ? AND (event_occurrences.date >= ? AND schedulable_type = ?) ORDER BY date ASC [["schedulable_id", 1], ["schedulable_type", "Event"], [nil, "2025-09-22 05:48:20.010515"], [nil, "EventOccurrence"]] + TRANSACTION (0.0ms) RELEASE SAVEPOINT active_record_1 + TRANSACTION (0.3ms) rollback transaction + TRANSACTION (0.0ms) begin transaction +---------------------------------------------------- +SchedulableTest: test_schedule_generates_occurrences +---------------------------------------------------- + TRANSACTION (0.0ms) SAVEPOINT active_record_1 + Schedule Create (0.1ms) INSERT INTO "schedules" ("schedulable_id", "schedulable_type", "date", "time", "rule", "interval", "day", "day_of_week", "until", "count", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING "id" [["schedulable_id", nil], ["schedulable_type", nil], ["date", nil], ["time", "2000-01-01 07:48:20.018438"], ["rule", "weekly"], ["interval", nil], ["day", "---\n- monday\n"], ["day_of_week", nil], ["until", "2025-12-22 06:48:20.018456"], ["count", 10], ["created_at", "2025-09-22 05:48:20.021255"], ["updated_at", "2025-09-22 05:48:20.021255"]] + TRANSACTION (0.0ms) RELEASE SAVEPOINT active_record_1 + TRANSACTION (0.0ms) SAVEPOINT active_record_1 + Event Create (0.1ms) INSERT INTO "events" ("name", "created_at", "updated_at") VALUES (?, ?, ?) RETURNING "id" [["name", "My Event"], ["created_at", "2025-09-22 05:48:20.026450"], ["updated_at", "2025-09-22 05:48:20.026450"]] + Schedule Update (0.1ms) UPDATE "schedules" SET "schedulable_id" = ?, "schedulable_type" = ?, "updated_at" = ? WHERE "schedules"."id" = ? [["schedulable_id", 1], ["schedulable_type", "Event"], ["updated_at", "2025-09-22 05:48:20.030504"], ["id", 1]] + EventOccurrence Load (0.1ms) SELECT "event_occurrences".* FROM "event_occurrences" WHERE "event_occurrences"."schedulable_id" = ? AND "event_occurrences"."schedulable_type" = ? AND (event_occurrences.date >= ? AND schedulable_type = ?) ORDER BY date ASC [["schedulable_id", 1], ["schedulable_type", "Event"], [nil, "2025-09-22 05:48:20.040706"], [nil, "EventOccurrence"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-09-22 06:48:20"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:48:20.044825"], ["updated_at", "2025-09-22 05:48:20.044825"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-09-29 06:48:20"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:48:20.045592"], ["updated_at", "2025-09-22 05:48:20.045592"]] + EventOccurrence Create (0.1ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-10-06 06:48:20"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:48:20.046357"], ["updated_at", "2025-09-22 05:48:20.046357"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-10-13 06:48:20"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:48:20.047084"], ["updated_at", "2025-09-22 05:48:20.047084"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-10-20 06:48:20"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:48:20.047348"], ["updated_at", "2025-09-22 05:48:20.047348"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-10-27 07:48:20"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:48:20.050261"], ["updated_at", "2025-09-22 05:48:20.050261"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-11-03 07:48:20"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:48:20.051241"], ["updated_at", "2025-09-22 05:48:20.051241"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-11-10 07:48:20"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:48:20.051422"], ["updated_at", "2025-09-22 05:48:20.051422"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-11-17 07:48:20"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:48:20.051590"], ["updated_at", "2025-09-22 05:48:20.051590"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-11-24 07:48:20"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:48:20.051767"], ["updated_at", "2025-09-22 05:48:20.051767"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-12-01 07:48:20"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:48:20.051944"], ["updated_at", "2025-09-22 05:48:20.051944"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-12-08 07:48:20"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:48:20.052127"], ["updated_at", "2025-09-22 05:48:20.052127"]] + EventOccurrence Load (0.0ms) SELECT "event_occurrences".* FROM "event_occurrences" WHERE "event_occurrences"."schedulable_id" = ? AND "event_occurrences"."schedulable_type" = ? AND (event_occurrences.date >= ? AND schedulable_type = ?) ORDER BY date ASC [["schedulable_id", 1], ["schedulable_type", "Event"], [nil, "2025-09-22 05:48:20.053434"], [nil, "EventOccurrence"]] + TRANSACTION (0.0ms) RELEASE SAVEPOINT active_record_1 + TRANSACTION (0.4ms) rollback transaction + TRANSACTION (0.0ms) begin transaction +----------------------------------------------------- +SchedulableTest: test_schedule_has_correct_attributes +----------------------------------------------------- + TRANSACTION (0.0ms) SAVEPOINT active_record_1 + Schedule Create (0.2ms) INSERT INTO "schedules" ("schedulable_id", "schedulable_type", "date", "time", "rule", "interval", "day", "day_of_week", "until", "count", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING "id" [["schedulable_id", nil], ["schedulable_type", nil], ["date", nil], ["time", "2000-01-01 07:48:20.058538"], ["rule", "weekly"], ["interval", nil], ["day", "---\n- monday\n"], ["day_of_week", nil], ["until", "2025-12-22 06:48:20.058553"], ["count", 10], ["created_at", "2025-09-22 05:48:20.060551"], ["updated_at", "2025-09-22 05:48:20.060551"]] + TRANSACTION (0.0ms) RELEASE SAVEPOINT active_record_1 + TRANSACTION (0.0ms) SAVEPOINT active_record_1 + Event Create (0.1ms) INSERT INTO "events" ("name", "created_at", "updated_at") VALUES (?, ?, ?) RETURNING "id" [["name", "My Event"], ["created_at", "2025-09-22 05:48:20.061447"], ["updated_at", "2025-09-22 05:48:20.061447"]] + Schedule Update (0.0ms) UPDATE "schedules" SET "schedulable_id" = ?, "schedulable_type" = ?, "updated_at" = ? WHERE "schedules"."id" = ? [["schedulable_id", 1], ["schedulable_type", "Event"], ["updated_at", "2025-09-22 05:48:20.062227"], ["id", 1]] + EventOccurrence Load (0.1ms) SELECT "event_occurrences".* FROM "event_occurrences" WHERE "event_occurrences"."schedulable_id" = ? AND "event_occurrences"."schedulable_type" = ? AND (event_occurrences.date >= ? AND schedulable_type = ?) ORDER BY date ASC [["schedulable_id", 1], ["schedulable_type", "Event"], [nil, "2025-09-22 05:48:20.067660"], [nil, "EventOccurrence"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-09-22 06:48:20"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:48:20.068517"], ["updated_at", "2025-09-22 05:48:20.068517"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-09-29 06:48:20"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:48:20.068749"], ["updated_at", "2025-09-22 05:48:20.068749"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-10-06 06:48:20"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:48:20.068956"], ["updated_at", "2025-09-22 05:48:20.068956"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-10-13 06:48:20"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:48:20.069122"], ["updated_at", "2025-09-22 05:48:20.069122"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-10-20 06:48:20"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:48:20.069280"], ["updated_at", "2025-09-22 05:48:20.069280"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-10-27 07:48:20"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:48:20.069435"], ["updated_at", "2025-09-22 05:48:20.069435"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-11-03 07:48:20"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:48:20.069592"], ["updated_at", "2025-09-22 05:48:20.069592"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-11-10 07:48:20"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:48:20.069766"], ["updated_at", "2025-09-22 05:48:20.069766"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-11-17 07:48:20"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:48:20.069923"], ["updated_at", "2025-09-22 05:48:20.069923"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-11-24 07:48:20"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:48:20.070070"], ["updated_at", "2025-09-22 05:48:20.070070"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-12-01 07:48:20"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:48:20.070298"], ["updated_at", "2025-09-22 05:48:20.070298"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-12-08 07:48:20"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:48:20.070445"], ["updated_at", "2025-09-22 05:48:20.070445"]] + EventOccurrence Load (0.1ms) SELECT "event_occurrences".* FROM "event_occurrences" WHERE "event_occurrences"."schedulable_id" = ? AND "event_occurrences"."schedulable_type" = ? AND (event_occurrences.date >= ? AND schedulable_type = ?) ORDER BY date ASC [["schedulable_id", 1], ["schedulable_type", "Event"], [nil, "2025-09-22 05:48:20.070817"], [nil, "EventOccurrence"]] + TRANSACTION (0.0ms) RELEASE SAVEPOINT active_record_1 + TRANSACTION (0.0ms) rollback transaction + TRANSACTION (0.0ms) begin transaction +----------------------------------------------------------------- +SchedulableTest: test_schedule_serializes_day_attribute_correctly +----------------------------------------------------------------- + TRANSACTION (0.0ms) SAVEPOINT active_record_1 + Schedule Create (0.1ms) INSERT INTO "schedules" ("schedulable_id", "schedulable_type", "date", "time", "rule", "interval", "day", "day_of_week", "until", "count", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING "id" [["schedulable_id", nil], ["schedulable_type", nil], ["date", nil], ["time", "2000-01-01 07:48:20.074182"], ["rule", "weekly"], ["interval", nil], ["day", "---\n- monday\n"], ["day_of_week", nil], ["until", "2025-12-22 06:48:20.074542"], ["count", 10], ["created_at", "2025-09-22 05:48:20.076425"], ["updated_at", "2025-09-22 05:48:20.076425"]] + TRANSACTION (0.0ms) RELEASE SAVEPOINT active_record_1 + TRANSACTION (0.0ms) SAVEPOINT active_record_1 + Event Create (0.1ms) INSERT INTO "events" ("name", "created_at", "updated_at") VALUES (?, ?, ?) RETURNING "id" [["name", "My Event"], ["created_at", "2025-09-22 05:48:20.076968"], ["updated_at", "2025-09-22 05:48:20.076968"]] + Schedule Update (0.0ms) UPDATE "schedules" SET "schedulable_id" = ?, "schedulable_type" = ?, "updated_at" = ? WHERE "schedules"."id" = ? [["schedulable_id", 1], ["schedulable_type", "Event"], ["updated_at", "2025-09-22 05:48:20.077407"], ["id", 1]] + EventOccurrence Load (0.1ms) SELECT "event_occurrences".* FROM "event_occurrences" WHERE "event_occurrences"."schedulable_id" = ? AND "event_occurrences"."schedulable_type" = ? AND (event_occurrences.date >= ? AND schedulable_type = ?) ORDER BY date ASC [["schedulable_id", 1], ["schedulable_type", "Event"], [nil, "2025-09-22 05:48:20.083502"], [nil, "EventOccurrence"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-09-22 06:48:20"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:48:20.084972"], ["updated_at", "2025-09-22 05:48:20.084972"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-09-29 06:48:20"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:48:20.085198"], ["updated_at", "2025-09-22 05:48:20.085198"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-10-06 06:48:20"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:48:20.085415"], ["updated_at", "2025-09-22 05:48:20.085415"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-10-13 06:48:20"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:48:20.085596"], ["updated_at", "2025-09-22 05:48:20.085596"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-10-20 06:48:20"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:48:20.085750"], ["updated_at", "2025-09-22 05:48:20.085750"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-10-27 07:48:20"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:48:20.085900"], ["updated_at", "2025-09-22 05:48:20.085900"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-11-03 07:48:20"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:48:20.086069"], ["updated_at", "2025-09-22 05:48:20.086069"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-11-10 07:48:20"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:48:20.086236"], ["updated_at", "2025-09-22 05:48:20.086236"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-11-17 07:48:20"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:48:20.086396"], ["updated_at", "2025-09-22 05:48:20.086396"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-11-24 07:48:20"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:48:20.086542"], ["updated_at", "2025-09-22 05:48:20.086542"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-12-01 07:48:20"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:48:20.086704"], ["updated_at", "2025-09-22 05:48:20.086704"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-12-08 07:48:20"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:48:20.086865"], ["updated_at", "2025-09-22 05:48:20.086865"]] + EventOccurrence Load (0.0ms) SELECT "event_occurrences".* FROM "event_occurrences" WHERE "event_occurrences"."schedulable_id" = ? AND "event_occurrences"."schedulable_type" = ? AND (event_occurrences.date >= ? AND schedulable_type = ?) ORDER BY date ASC [["schedulable_id", 1], ["schedulable_type", "Event"], [nil, "2025-09-22 05:48:20.086996"], [nil, "EventOccurrence"]] + TRANSACTION (0.0ms) RELEASE SAVEPOINT active_record_1 + TRANSACTION (0.0ms) SAVEPOINT active_record_1 + Schedule Create (0.3ms) INSERT INTO "schedules" ("schedulable_id", "schedulable_type", "date", "time", "rule", "interval", "day", "day_of_week", "until", "count", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING "id" [["schedulable_id", nil], ["schedulable_type", nil], ["date", nil], ["time", "2000-01-01 07:48:20.089343"], ["rule", "weekly"], ["interval", nil], ["day", "---\n- monday\n- wednesday\n"], ["day_of_week", nil], ["until", "2025-12-22 06:48:20.089359"], ["count", 10], ["created_at", "2025-09-22 05:48:20.089806"], ["updated_at", "2025-09-22 05:48:20.089806"]] + TRANSACTION (0.0ms) RELEASE SAVEPOINT active_record_1 + Schedule Load (1.0ms) SELECT "schedules".* FROM "schedules" WHERE "schedules"."id" = ? LIMIT ? [["id", 2], ["LIMIT", 1]] + TRANSACTION (0.0ms) rollback transaction + TRANSACTION (0.0ms) begin transaction +------------------------------------------------------------------------- +SchedulableTest: test_schedule_serializes_day_of_week_attribute_correctly +------------------------------------------------------------------------- + TRANSACTION (0.0ms) SAVEPOINT active_record_1 + Schedule Create (0.1ms) INSERT INTO "schedules" ("schedulable_id", "schedulable_type", "date", "time", "rule", "interval", "day", "day_of_week", "until", "count", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING "id" [["schedulable_id", nil], ["schedulable_type", nil], ["date", nil], ["time", "2000-01-01 07:48:20.098770"], ["rule", "weekly"], ["interval", nil], ["day", "---\n- monday\n"], ["day_of_week", nil], ["until", "2025-12-22 06:48:20.098783"], ["count", 10], ["created_at", "2025-09-22 05:48:20.099260"], ["updated_at", "2025-09-22 05:48:20.099260"]] + TRANSACTION (0.0ms) RELEASE SAVEPOINT active_record_1 + TRANSACTION (0.0ms) SAVEPOINT active_record_1 + Event Create (0.1ms) INSERT INTO "events" ("name", "created_at", "updated_at") VALUES (?, ?, ?) RETURNING "id" [["name", "My Event"], ["created_at", "2025-09-22 05:48:20.104193"], ["updated_at", "2025-09-22 05:48:20.104193"]] + Schedule Update (0.0ms) UPDATE "schedules" SET "schedulable_id" = ?, "schedulable_type" = ?, "updated_at" = ? WHERE "schedules"."id" = ? [["schedulable_id", 1], ["schedulable_type", "Event"], ["updated_at", "2025-09-22 05:48:20.104547"], ["id", 1]] + EventOccurrence Load (0.1ms) SELECT "event_occurrences".* FROM "event_occurrences" WHERE "event_occurrences"."schedulable_id" = ? AND "event_occurrences"."schedulable_type" = ? AND (event_occurrences.date >= ? AND schedulable_type = ?) ORDER BY date ASC [["schedulable_id", 1], ["schedulable_type", "Event"], [nil, "2025-09-22 05:48:20.121913"], [nil, "EventOccurrence"]] + EventOccurrence Create (0.1ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-09-22 06:48:20"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:48:20.122592"], ["updated_at", "2025-09-22 05:48:20.122592"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-09-29 06:48:20"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:48:20.122883"], ["updated_at", "2025-09-22 05:48:20.122883"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-10-06 06:48:20"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:48:20.123242"], ["updated_at", "2025-09-22 05:48:20.123242"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-10-13 06:48:20"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:48:20.123428"], ["updated_at", "2025-09-22 05:48:20.123428"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-10-20 06:48:20"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:48:20.123593"], ["updated_at", "2025-09-22 05:48:20.123593"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-10-27 07:48:20"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:48:20.123751"], ["updated_at", "2025-09-22 05:48:20.123751"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-11-03 07:48:20"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:48:20.123907"], ["updated_at", "2025-09-22 05:48:20.123907"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-11-10 07:48:20"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:48:20.124067"], ["updated_at", "2025-09-22 05:48:20.124067"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-11-17 07:48:20"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:48:20.124407"], ["updated_at", "2025-09-22 05:48:20.124407"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-11-24 07:48:20"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:48:20.124576"], ["updated_at", "2025-09-22 05:48:20.124576"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-12-01 07:48:20"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:48:20.124735"], ["updated_at", "2025-09-22 05:48:20.124735"]] + EventOccurrence Create (0.0ms) INSERT INTO "event_occurrences" ("date", "schedulable_id", "schedulable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) RETURNING "id" [["date", "2025-12-08 07:48:20"], ["schedulable_id", 1], ["schedulable_type", "Event"], ["created_at", "2025-09-22 05:48:20.124894"], ["updated_at", "2025-09-22 05:48:20.124894"]] + EventOccurrence Load (0.0ms) SELECT "event_occurrences".* FROM "event_occurrences" WHERE "event_occurrences"."schedulable_id" = ? AND "event_occurrences"."schedulable_type" = ? AND (event_occurrences.date >= ? AND schedulable_type = ?) ORDER BY date ASC [["schedulable_id", 1], ["schedulable_type", "Event"], [nil, "2025-09-22 05:48:20.126568"], [nil, "EventOccurrence"]] + TRANSACTION (0.0ms) RELEASE SAVEPOINT active_record_1 + TRANSACTION (0.0ms) SAVEPOINT active_record_1 + Schedule Create (0.3ms) INSERT INTO "schedules" ("schedulable_id", "schedulable_type", "date", "time", "rule", "interval", "day", "day_of_week", "until", "count", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING "id" [["schedulable_id", nil], ["schedulable_type", nil], ["date", nil], ["time", "2000-01-01 07:48:20.127114"], ["rule", "monthly"], ["interval", nil], ["day", "---\n- monday\n"], ["day_of_week", "---\nmonday:\n- 1\n- 3\nwednesday:\n- 2\n- 4\n"], ["until", "2025-12-22 06:48:20.127131"], ["count", 10], ["created_at", "2025-09-22 05:48:20.134090"], ["updated_at", "2025-09-22 05:48:20.134090"]] + TRANSACTION (0.0ms) RELEASE SAVEPOINT active_record_1 + Schedule Load (0.1ms) SELECT "schedules".* FROM "schedules" WHERE "schedules"."id" = ? LIMIT ? [["id", 2], ["LIMIT", 1]] + TRANSACTION (0.0ms) rollback transaction diff --git a/test/dummy/test/factories/event_occurrences.rb b/test/dummy/test/factories/event_occurrences.rb deleted file mode 100644 index 32b1058..0000000 --- a/test/dummy/test/factories/event_occurrences.rb +++ /dev/null @@ -1,7 +0,0 @@ -FactoryGirl.define do - factory :event_occurrence do - date "2015-04-08 21:12:41" -schedulable nil - end - -end diff --git a/test/factories.rb b/test/factories.rb index 9f1cb20..b836fca 100644 --- a/test/factories.rb +++ b/test/factories.rb @@ -1,15 +1,20 @@ -FactoryGirl.define do +FactoryBot.define do factory :schedule do - rule 'weekly' - day ['monday'] - time Time.now + 1.hour - count 10 - self.until DateTime.now + 3.months + rule { 'weekly' } + day { ['monday'] } + time { Time.current + 1.hour } + count { 10 } + self.until { Time.current + 3.months } end factory :event do - name "My Event" - schedule + name { "My Event" } + association :schedule + end + + factory :event_occurrence do + date { Time.current } + schedulable { nil } end end \ No newline at end of file diff --git a/test/schedulable_test.rb b/test/schedulable_test.rb index 00cbc9b..4ba4ea4 100644 --- a/test/schedulable_test.rb +++ b/test/schedulable_test.rb @@ -1,16 +1,45 @@ require 'test_helper' -require 'database_cleaner' +require 'database_cleaner-active_record' class SchedulableTest < ActiveSupport::TestCase - puts "HELLO" - - DatabaseCleaner.clean_with(:truncation) - DatabaseCleaner.start - - event = FactoryGirl.create(:event) - puts event.name + setup do + @event = FactoryBot.create(:event) + end - test "truth" do + test "module exists" do assert_kind_of Module, Schedulable end + + test "can create event with schedule" do + assert_not_nil @event.schedule + assert_equal 'weekly', @event.schedule.rule + end + + test "schedule has correct attributes" do + schedule = @event.schedule + assert_equal ['monday'], schedule.day + assert_equal 10, schedule.count + assert_instance_of Time, schedule.time.to_time + end + + test "schedule generates occurrences" do + schedule = @event.schedule + occurrences = schedule.occurrences(Time.current + 2.months) + assert_not_empty occurrences + assert_instance_of Array, occurrences + assert occurrences.all? { |o| o.is_a?(Time) } + end + + test "schedule serializes day attribute correctly" do + schedule = FactoryBot.create(:schedule, day: ['monday', 'wednesday']) + schedule.reload + assert_equal ['monday', 'wednesday'], schedule.day + end + + test "schedule serializes day_of_week attribute correctly" do + day_of_week = { 'monday' => [1, 3], 'wednesday' => [2, 4] } + schedule = FactoryBot.create(:schedule, rule: 'monthly', day_of_week: day_of_week) + schedule.reload + assert_equal day_of_week, schedule.day_of_week + end end \ No newline at end of file diff --git a/test/test_helper.rb b/test/test_helper.rb index 014184a..7f8922c 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -1,19 +1,23 @@ # Configure Rails Environment ENV["RAILS_ENV"] = "test" -require File.expand_path("../dummy/config/environment.rb", __FILE__) -require 'factory_girl' +require File.expand_path("../dummy/config/environment.rb", __FILE__) require "rails/test_help" - -FactoryGirl.definition_file_paths << File.join(File.dirname(__FILE__), 'factories') -FactoryGirl.find_definitions - -Rails.backtrace_cleaner.remove_silencers! +require "factory_bot" # Load support files Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f } -# Load fixtures from the engine -if ActiveSupport::TestCase.method_defined?(:fixture_path=) - ActiveSupport::TestCase.fixture_path = File.expand_path("../fixtures", __FILE__) +# Configure FactoryBot +FactoryBot.definition_file_paths << File.join(File.dirname(__FILE__), 'factories') +FactoryBot.find_definitions + +class ActiveSupport::TestCase + # Run tests in parallel with specified workers + parallelize(workers: :number_of_processors) + + # Setup all fixtures in test/fixtures/*.yml + fixtures :all + + # Add more helper methods to be used by all tests here... end \ No newline at end of file