ltree_hierarchy
ltree_hierarchy copied to clipboard
Only include main method in ActiveRecord::Base
Right now the gem extends ActiveRecord::Base
with all the supported class methods, which means they will be included in every model in the app, not just the ones with ltree
support. This has led to some confusion on my part and it can lead to errors when an unrelated model wants to define e.g. a roots
scope for itself.
This PR moves these methods to a ClassMethods
module and only includes them when has_ltree_hierarchy
is called.
is it possible to merge this ?