Skip to content

Using Module#prepend on an ActiveRecord::Base class causes callbacks to go missing #10899

bcardarella opened this Issue Jun 10, 2013 · 2 comments

1 participant


Run the following: (you must be using Ruby 2.0 obviously)

require 'active_record'

  :adapter => defined?(JRUBY_VERSION) ? 'jdbcsqlite3' : 'sqlite3',
  :database => ':memory:'

ActiveRecord::Base.connection.execute('CREATE TABLE users (id INTEGER PRIMARY KEY, email TEXT)')

module A; end

class User < ActiveRecord::Base
  prepend A


The last line will blow up with an error similar to _run__XXXXXXX__validation__callbacks cannot be found.

I tried tracing this one down but ActiveSupport::Callbacks is beyond me.


This is happening on both Rails 3.2.x an Rails 4.0.beta.1


Nevermind, this looks like it was a bug in Ruby 2.0.0-p0 but was resolved in 2.0.0-p195

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.