lib/sunspot/rails/adapters.rb in sunspot_rails-2.0.0.pre.120925 vs lib/sunspot/rails/adapters.rb in sunspot_rails-2.0.0.pre.130115
- old
+ new
@@ -18,11 +18,12 @@
end
end
class ActiveRecordDataAccessor < Sunspot::Adapters::DataAccessor
# options for the find
- attr_accessor :include, :select
+ attr_accessor :include
+ attr_reader :select
def initialize(clazz)
super(clazz)
@inherited_attributes = [:include, :select]
end
@@ -76,11 +77,11 @@
private
def options_for_find
options = {}
- options[:include] = @include unless @include.blank?
- options[:select] = @select unless @select.blank?
+ options[:include] = @include unless !defined?(@include) || @include.blank?
+ options[:select] = @select unless !defined?(@select) || @select.blank?
options
end
end
end
end