HomePhorge

(#16376) Fix rails compatibility layer for activerecord < 3.0
f8a4ddcea2ebUnpublished

Unpublished Commit ยท Learn More

Repository Importing: This repository is still importing.

Description

(#16376) Fix rails compatibility layer for activerecord < 3.0

Previously an alias was attempted between scope and named_scope to allow older
activerecord versions (< 3.0) to work with the inventory service while also
supporting modern activerecord. The scope alias failed because
Puppet::Rails::InventoryNode inherits from ActiveRecord::Base, which has a
scope method already. So activerecord's scope method is found instead of the
intended alias target. This commit removes the alias and simply switches on
activerecord version to use the correct scope (AR >= 3.0) or named_scope (AR <
3.0) method.

Details

Provenance
Matthaus Litteken <matthaus@puppetlabs.com>Authored on
vanmeeuwenPushed on Jun 2 2015, 2:22 PM
Parents
rPU7258be6e66f3: Merge branch 'ticket/2.7.x/16347-gem-install' into 2.7.x
Branches
Unknown
Tags
Unknown

Event Timeline

Matthaus Litteken <matthaus@puppetlabs.com> committed rPUf8a4ddcea2eb: (#16376) Fix rails compatibility layer for activerecord < 3.0 (authored by Matthaus Litteken <matthaus@puppetlabs.com>).Sep 12 2012, 7:50 PM