Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Psych::DisallowedClass (Tried to load unspecified class: Time): #532

Open
Greyoxide opened this issue Aug 24, 2022 · 2 comments
Open

Psych::DisallowedClass (Tried to load unspecified class: Time): #532

Greyoxide opened this issue Aug 24, 2022 · 2 comments

Comments

@Greyoxide
Copy link

I'm not sure why I'm getting this error, I set up a test app and was able to schedule a recurring rule. Whereas in my production app I get this error. The only configuration difference that may apply is that I have the following in application.rb config.beginning_of_week = :sunday

here's event.rb


class Event < ApplicationRecord
  
  include IceCube
  require 'active_support/time'
  serialize :recurrence, IceCube::Schedule
  
  before_save :schedule
  
  def schedule
    if recurrence.nil?
      self.recurrence = Schedule.new(starts_at) do |s|
        if cycle == 'Weekly'
          s.add_recurrence_rule Rule.weekly(week_step.to_i) if week_step.present?
          s.add_recurrence_rule Rule.weekly.day(symbolize_days) if week_day_list.present?
        end
      end
    else
      self.recurrence
    end
  end
end
@Faq
Copy link

Faq commented Sep 21, 2022

You did not provide any exact versions info:
ice_cube what version? rev hash
Psych?
rails, ruby

@danielricecodes
Copy link

danielricecodes commented Oct 28, 2022

@Greyoxide @Faq - this is fixed in master. See: https://github.com/ice-cube-ruby/ice_cube/blob/master/lib/ice_cube/parsers/yaml_parser.rb#L10

Until there is a new gem version released that contains this commit, you can update your Gemfile:

git_source(:github) { |repo| "https://github.com/#{repo}.git" }

gem 'ice_cube',
  github: 'ice-cube-ruby/ice_cube',
  ref: '6b97e77c106cd6662cb7292a5f59b01e4ccaedc6'

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

No branches or pull requests

3 participants