Permalink
Browse files

Use Arel for scope

  • Loading branch information...
1 parent 9178d2b commit 3fa6c68ecf85fc6c6081a7f346766db7ff8e8f37 @BDQ BDQ committed with joneslee85 Feb 9, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 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

0 comments on commit 3fa6c68

Please sign in to comment.