Skip to content

Commit

Permalink
remove order when not used
Browse files Browse the repository at this point in the history
  • Loading branch information
axelerator committed May 28, 2014
1 parent 4c46b41 commit dc84679
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/forty_facets/filter/belongs_to.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def build_scope

def facet
my_column = association.association_foreign_key
counts = without.result.select("#{my_column} as foreign_id, count(#{my_column}) as occurrences").group(my_column)
counts = without.result.reorder('').select("#{my_column} as foreign_id, count(#{my_column}) as occurrences").group(my_column)
entities_by_id = klass.find(counts.map(&:foreign_id)).group_by(&:id)
facet = counts.inject([]) do |sum, count|
facet_entity = entities_by_id[count.foreign_id].first
Expand Down
2 changes: 1 addition & 1 deletion lib/forty_facets/filter/range_filter_definition.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def max_value
end

def absolute_interval
@abosultes ||= without.result.select("min(#{filter_definition.model_field}) as min, max(#{filter_definition.model_field}) as max").first
@abosultes ||= without.result.reorder('').select("min(#{filter_definition.model_field}) as min, max(#{filter_definition.model_field}) as max").first
end

def absolute_min
Expand Down
2 changes: 1 addition & 1 deletion lib/forty_facets/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module FortyFacets
VERSION = "0.0.4"
VERSION = "0.0.5"
end

0 comments on commit dc84679

Please sign in to comment.