ltree_hierarchy icon indicating copy to clipboard operation
ltree_hierarchy copied to clipboard

Only include main method in ActiveRecord::Base

Open attilahorvath opened this issue 5 years ago • 1 comments

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.

attilahorvath avatar Jan 29 '20 15:01 attilahorvath

is it possible to merge this ?

MathieuDerelle avatar Aug 11 '21 13:08 MathieuDerelle