From 4f08923a766ba23322f562d875b7359aa960a4eb Mon Sep 17 00:00:00 2001 From: Jon Atack Date: Mon, 22 Sep 2014 21:42:14 +0200 Subject: [PATCH] Fix test suite AR conditional in previous commit as the test was not being run at all and should not be run with Rails 4.2. --- spec/ransack/adapters/active_record/context_spec.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/spec/ransack/adapters/active_record/context_spec.rb b/spec/ransack/adapters/active_record/context_spec.rb index eefca31..3d9fb41 100644 --- a/spec/ransack/adapters/active_record/context_spec.rb +++ b/spec/ransack/adapters/active_record/context_spec.rb @@ -3,7 +3,8 @@ require 'spec_helper' module Ransack module Adapters module ActiveRecord - AR_version = ::ActiveRecord::VERSION::STRING + version = ::ActiveRecord::VERSION + AR_version = "#{version::MAJOR}.#{version::MINOR}" describe Context do subject { Context.new(Person) } @@ -70,7 +71,7 @@ module Ransack # FIXME: fix this test for Rails 4.2. it 'returns dependent arel join nodes for all searches run against the context', - :if => %w(3.1 3.2 4.0 4.1 4.2).include?(AR_version) do + :if => %w(3.1 3.2 4.0 4.1).include?(AR_version) do parents, children = shared_context.join_sources expect(children.left.name).to eq "children_people"