module Bullet::Dependency
Public Instance Methods
Source
# File lib/bullet/dependency.rb, line 87 def active_record40? active_record4? && ::ActiveRecord::VERSION::MINOR == 0 end
Source
# File lib/bullet/dependency.rb, line 91 def active_record41? active_record4? && ::ActiveRecord::VERSION::MINOR == 1 end
Source
# File lib/bullet/dependency.rb, line 95 def active_record42? active_record4? && ::ActiveRecord::VERSION::MINOR == 2 end
Source
# File lib/bullet/dependency.rb, line 67 def active_record4? active_record? && ::ActiveRecord::VERSION::MAJOR == 4 end
Source
# File lib/bullet/dependency.rb, line 99 def active_record50? active_record5? && ::ActiveRecord::VERSION::MINOR == 0 end
Source
# File lib/bullet/dependency.rb, line 103 def active_record51? active_record5? && ::ActiveRecord::VERSION::MINOR == 1 end
Source
# File lib/bullet/dependency.rb, line 107 def active_record52? active_record5? && ::ActiveRecord::VERSION::MINOR == 2 end
Source
# File lib/bullet/dependency.rb, line 71 def active_record5? active_record? && ::ActiveRecord::VERSION::MAJOR == 5 end
Source
# File lib/bullet/dependency.rb, line 111 def active_record60? active_record6? && ::ActiveRecord::VERSION::MINOR == 0 end
Source
# File lib/bullet/dependency.rb, line 115 def active_record61? active_record6? && ::ActiveRecord::VERSION::MINOR == 1 end
Source
# File lib/bullet/dependency.rb, line 75 def active_record6? active_record? && ::ActiveRecord::VERSION::MAJOR == 6 end
Source
# File lib/bullet/dependency.rb, line 119 def active_record70? active_record7? && ::ActiveRecord::VERSION::MINOR == 0 end
Source
# File lib/bullet/dependency.rb, line 123 def active_record71? active_record7? && ::ActiveRecord::VERSION::MINOR == 1 end
Source
# File lib/bullet/dependency.rb, line 127 def active_record72? active_record7? && ::ActiveRecord::VERSION::MINOR == 2 end
Source
# File lib/bullet/dependency.rb, line 79 def active_record7? active_record? && ::ActiveRecord::VERSION::MAJOR == 7 end
Source
# File lib/bullet/dependency.rb, line 131 def active_record80? active_record8? && ::ActiveRecord::VERSION::MINOR == 0 end
Source
# File lib/bullet/dependency.rb, line 83 def active_record8? active_record? && ::ActiveRecord::VERSION::MAJOR == 8 end
Source
# File lib/bullet/dependency.rb, line 9 def active_record? @active_record ||= defined?(::ActiveRecord) end
Source
# File lib/bullet/dependency.rb, line 13 def active_record_version @active_record_version ||= begin if active_record40? 'active_record4' elsif active_record41? 'active_record41' elsif active_record42? 'active_record42' elsif active_record50? 'active_record5' elsif active_record51? 'active_record5' elsif active_record52? 'active_record52' elsif active_record60? 'active_record60' elsif active_record61? 'active_record61' elsif active_record70? 'active_record70' elsif active_record71? 'active_record71' elsif active_record72? 'active_record72' elsif active_record80? 'active_record80' else raise "Bullet does not support active_record #{::ActiveRecord::VERSION::STRING} yet" end end end
Source
# File lib/bullet/dependency.rb, line 135 def mongoid4x? mongoid? && ::Mongoid::VERSION =~ /\A4/ end
Source
# File lib/bullet/dependency.rb, line 139 def mongoid5x? mongoid? && ::Mongoid::VERSION =~ /\A5/ end
Source
# File lib/bullet/dependency.rb, line 143 def mongoid6x? mongoid? && ::Mongoid::VERSION =~ /\A6/ end
Source
# File lib/bullet/dependency.rb, line 147 def mongoid7x? mongoid? && ::Mongoid::VERSION =~ /\A7/ end
Source
# File lib/bullet/dependency.rb, line 151 def mongoid8x? mongoid? && ::Mongoid::VERSION =~ /\A8/ end
Source
# File lib/bullet/dependency.rb, line 155 def mongoid9x? mongoid? && ::Mongoid::VERSION =~ /\A9/ end
Source
# File lib/bullet/dependency.rb, line 5 def mongoid? @mongoid ||= defined?(::Mongoid) end
Source
# File lib/bullet/dependency.rb, line 46 def mongoid_version @mongoid_version ||= begin if mongoid4x? 'mongoid4x' elsif mongoid5x? 'mongoid5x' elsif mongoid6x? 'mongoid6x' elsif mongoid7x? 'mongoid7x' elsif mongoid8x? 'mongoid8x' elsif mongoid9x? 'mongoid9x' else raise "Bullet does not support mongoid #{::Mongoid::VERSION} yet" end end end