Sha256: 20e67aec2783638c40e7d99f2fea550e85833648fa02bf5f807995fe72a21301
Contents?: true
Size: 504 Bytes
Versions: 4
Compression:
Stored size: 504 Bytes
Contents
module RailsMacros # NOTE: This method is not fun to maintain but we need it to make sure # Partisan methods return *real* not-loaded ActiveRecord relations def relation_class(klass) if ActiveRecord::VERSION::MAJOR == 3 ActiveRecord::Relation elsif [ActiveRecord::VERSION::MAJOR, ActiveRecord::VERSION::MINOR] == [4, 0] "ActiveRecord::Relation::ActiveRecord_Relation_#{klass.name}".constantize else "#{klass.name}::ActiveRecord_Relation".constantize end end end
Version data entries
4 entries across 4 versions & 1 rubygems