Acts_as_paranoid and alias_method_chain

when i require acts_as_paranoid I’m getting: undefined method
`alias_method_chain’ for #Class:ActiveRecord::Base (NoMethodError)

It happens in acts_as_paranoid’s init.rb. here’s the whole file. the
alias_method_chain is near the bottom. please advise.

class << ActiveRecord::Base
def belongs_to_with_deleted(association_id, options = {})
with_deleted = options.delete :with_deleted
returning belongs_to_without_deleted(association_id, options) do
if with_deleted
reflection = reflect_on_association(association_id)
association_accessor_methods(reflection,
Caboose::Acts::BelongsToWithDeletedAssociation)
association_constructor_method(:build, reflection,
Caboose::Acts::BelongsToWithDeletedAssociation)
association_constructor_method(:create, reflection,
Caboose::Acts::BelongsToWithDeletedAssociation)
end
end
end

alias_method_chain :belongs_to, :deleted
end
ActiveRecord::Base.send :include, Caboose::Acts::Paranoid

– Elliot T.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs