lib/polyamorous.rb in polyamorous-1.2.0 vs lib/polyamorous.rb in polyamorous-1.3.0
- old
+ new
@@ -23,18 +23,11 @@
require 'polyamorous/tree_node'
require 'polyamorous/join'
require 'polyamorous/swapping_reflection_class'
- ar_version =
- case ::ActiveRecord::VERSION::STRING[0,3]
- when '4.2', '5.0'
- '4.2'
- when '4.1'
- '4.1'
- else
- '3_and_4.0'
- end
+ ar_version = ::ActiveRecord::VERSION::STRING[0,3]
+ ar_version = '3_and_4.0' if ar_version < '4.1'
method, ruby_version =
if RUBY_VERSION >= '2.0' && ar_version >= '4.1'
# Ruby 2; we can use `prepend` to patch Active Record cleanly.
[:prepend, '2']