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