parent
98d76af318
commit
b98af83c9d
3 changed files with 8 additions and 1 deletions
|
|
@ -1,6 +1,7 @@
|
|||
# 0.5.8.0
|
||||
|
||||
## Refactor
|
||||
* Sort tag autocompletion by tag name [#6734](https://github.com/diaspora/diaspora/pull/6734)
|
||||
|
||||
## Bug fixes
|
||||
* Fix empty name field when editing aspect names [#6706](https://github.com/diaspora/diaspora/pull/6706)
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ module ActsAsTaggableOn
|
|||
end
|
||||
|
||||
def self.autocomplete(name)
|
||||
where("name LIKE ?", "#{name.downcase}%")
|
||||
where("name LIKE ?", "#{name.downcase}%").order("name ASC")
|
||||
end
|
||||
|
||||
def self.normalize(name)
|
||||
|
|
|
|||
|
|
@ -13,6 +13,12 @@ describe ActsAsTaggableOn::Tag, :type => :model do
|
|||
it "does an end where on tags" do
|
||||
expect(tag.autocomplete("CAT")).to eq([tag_cats])
|
||||
end
|
||||
|
||||
it "sorts the results by name" do
|
||||
tag_cat = tag.create(name: "cat")
|
||||
tag_catt = tag.create(name: "catt")
|
||||
expect(tag.autocomplete("CAT")).to eq([tag_cat, tag_cats, tag_catt])
|
||||
end
|
||||
end
|
||||
|
||||
describe ".normalize" do
|
||||
|
|
|
|||
Loading…
Reference in a new issue