ABingo problems – Abingo is not missing constant Alternative!

Plugins, Ruby on Rails Add comments

If you’re seeing that exception, then I may have a solution for you. Following the reasoning of this blog post, it seems that it’s an issue with how Abingo namespaces the models.

Changing the two ABingo models to explicitly set the class name fixed it for me. YMMV

class Abingo::Alternative < ActiveRecord::Base
  include Abingo::ConversionRate

  belongs_to :experiment, :class_name => "::Abingo::Experiment"
  serialize :content
  ...
end

class Abingo::Experiment < ActiveRecord::Base
  include Abingo::Statistics
  include Abingo::ConversionRate

  has_many :alternatives, :dependent => :destroy, :class_name => "::Abingo::Alternative"
  validates_uniqueness_of :test_name
  ...
end

One Response to “ABingo problems – Abingo is not missing constant Alternative!”

  1. antoine Says:

    thank you so much !!!

Leave a Reply

WP Theme & Icons by N.Design Studio
Entries RSS Comments RSS Log in