Module: Thredded::Compat

Defined in:
lib/thredded/compat.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.rails_gte_60?Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (Boolean)

7
8
9
10
# File 'lib/thredded/compat.rb', line 7

def rails_gte_60?
  @rails_gte_60 = (Rails.gem_version >= Gem::Version.new('6.0.0')) if @rails_gte_60.nil?
  @rails_gte_60
end

.rails_gte_61?Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (Boolean)

13
14
15
16
# File 'lib/thredded/compat.rb', line 13

def rails_gte_61?
  @rails_gte_61 = (Rails.gem_version >= Gem::Version.new('6.1.0')) if @rails_gte_61.nil?
  @rails_gte_61
end

Instance Method Details

#association_preloader(records:, associations:, scope:) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.


20
21
22
23
24
# File 'lib/thredded/compat.rb', line 20

def association_preloader(records:, associations:, scope:)
  ActiveRecord::Associations::Preloader.new(
    records: records, associations: associations, scope: scope
  ).call
end