Skip to content

Commit

Permalink
Use Arel for scope
Browse files Browse the repository at this point in the history
  • Loading branch information
BDQ authored and Trung Lê committed Feb 20, 2012
1 parent 9178d2b commit 3fa6c68
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/app/models/spree/preference.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3fa6c68

Please sign in to comment.