From 3fa6c68ecf85fc6c6081a7f346766db7ff8e8f37 Mon Sep 17 00:00:00 2001 From: Brian Quinn Date: Thu, 9 Feb 2012 15:35:25 +0000 Subject: [PATCH] Use Arel for scope --- core/app/models/spree/preference.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/app/models/spree/preference.rb b/core/app/models/spree/preference.rb index db68e970a7a..2315e22e5d0 100644 --- a/core/app/models/spree/preference.rb +++ b/core/app/models/spree/preference.rb @@ -4,7 +4,7 @@ class Spree::Preference < ActiveRecord::Base validates :value, :presence => true validates :value_type, :presence => true - scope :valid, where("key IS NOT NULL").where("value_type IS NOT NULL") + scope :valid, where(Spree::Preference.arel_table[:key].not_eq(nil)).where(Spree::Preference.arel_table[:value_type].not_eq(nil)) # The type conversions here should match # the ones in spree::preferences::preferrable#convert_preference_value