Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[#72] Fixed a bug where the 'most wanted parse' highlight was highlig…

…hting the wrong item.
  • Loading branch information...
commit de31b392acd2c94f37dede9234db96ec130551c4 1 parent 1752868
@kohath kohath authored
Showing with 3 additions and 1 deletion.
  1. +1 −0  CHANGELOG
  2. +2 −1  app/models/locus.rb
View
1  CHANGELOG
@@ -3,6 +3,7 @@
* For [#63] fixed a bug where lexemes would associate with constructions not containing them.
* [#65] Ask for confirmation before removing fields from edit forms
* Randomize the expandlist on the front page (this is ugly)
+* [#72] Fixed a bug where the 'most wanted parse' highlight was highlighting the wrong item.
==Since 0.2.2==
* [#64] Fixed where loci in "all entries" under lexeme view didn't match the lexeme
View
3  app/models/locus.rb
@@ -18,7 +18,8 @@ class Locus < ActiveRecord::Base
accepts_nested_attributes_for :attestations, :allow_destroy => true, :reject_if => proc { |attributes| attributes.all? {|k,v| v.blank?} }
# Returns the parse with the most attestations that doesn't have an entry yet.
+ # I guess this should be part of Parse now
def most_wanted_parse
- parses.find(:first, :select => '"parses".id, "parses"."parsed_form", COUNT("parsed_form") AS count_all', :joins => ['LEFT OUTER JOIN "headwords" ON "headwords"."form" = "parsed_form"'], :group => '"parses"."parsed_form"', :conditions => {:headwords => {:form => nil}}, :order => 'count_all DESC')
+ Parse.find(:first, :select => '"parses".id, "parses"."parsed_form", COUNT("parsed_form") AS count_all', :joins => ['INNER JOIN "attestations" ON "parses"."attestation_id" = "attestations".id LEFT OUTER JOIN "headwords" ON ("headwords"."form" = "parses"."parsed_form")'], :group => '"parses"."parsed_form"', :conditions => {:headwords => {:form => nil}}, :order => 'count_all DESC', :having => {:attestations => {:locus_id => id}})
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.