Module: Saseo::Extensions::ActiveRecord::Detector

Extended by:
Detector
Included in:
Detector
Defined in:
lib/saseo/extensions/active_record/detector.rb

Instance Method Summary collapse

Instance Method Details

#active_record_detected?Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/saseo/extensions/active_record/detector.rb', line 11

def active_record_detected?
  !!active_record_version
end

#active_record_versionObject



6
7
8
9
# File 'lib/saseo/extensions/active_record/detector.rb', line 6

def active_record_version
  return nil unless (Object.const_get('ActiveRecord') rescue nil)
  ::ActiveRecord::VERSION::MAJOR
end