Changeset 332
- Timestamp:
- 02/29/08 19:20:34 (7 months ago)
- Files:
-
- trunk/plugin/acts_as_ferret/lib/class_methods.rb (modified) (1 diff)
- trunk/plugin/acts_as_ferret/lib/ferret_find_methods.rb (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/plugin/acts_as_ferret/lib/class_methods.rb
r323 r332 147 147 # +conitions+ present in +find_options+. 148 148 def find_with_ferret(q, options = {}, find_options = {}) 149 if scope(:find, :conditions) 150 if find_options[:conditions] 151 find_options[:conditions] = "(#{find_options[:conditions]}) AND (#{scope(:find, :conditions)})" 152 else 153 find_options[:conditions] = scope(:find, :conditions) 154 end 155 end 156 149 157 if options[:per_page] 150 158 options[:page] = options[:page] ? options[:page].to_i : 1 trunk/plugin/acts_as_ferret/lib/ferret_find_methods.rb
r327 r332 30 30 # count total_hits via sql when using conditions, multiple models, or when we're called 31 31 # from an ActiveRecord association. 32 if id_arrays.size > 1 or ar_options[:conditions] or caller.find{ |call| call =~ %r{active_record/associations} }32 if id_arrays.size > 1 or ar_options[:conditions] 33 33 # chances are the ferret result count is not our total_hits value, so 34 34 # we correct this here.
