Permalink
Browse files

more sql optimization, removed lower/distinct

  • Loading branch information...
1 parent f27c7ca commit bdd88b0e035939e4bd2ec4d88302a625ee23a9c1 Kevin committed with Wesley Beary Sep 2, 2010
Showing with 2 additions and 2 deletions.
  1. +1 −1 lib/acts_as_taggable.rb
  2. +1 −1 lib/acts_as_tagger.rb
View
@@ -8,7 +8,7 @@ def self.included(base)
module ClassMethods
def acts_as_taggable(options = {})
has_many :taggings, :as => :taggable, :dependent => :destroy, :include => :tag
- has_many :tags, :through => :taggings, :order => 'LOWER(name) asc', :select => "DISTINCT tags.*"
+ has_many :tags, :through => :taggings, :order => 'name'
after_save :update_tags
View
@@ -8,7 +8,7 @@ def self.included(base)
module ClassMethods
def acts_as_tagger(options = {})
has_many :taggings
- has_many :tags, :through => :taggings, :select => "DISTINCT #{Tag.table_name}.*", :order => "LOWER(name) asc"
+ has_many :tags, :through => :taggings, :order => "name"
extend ActiveRecord::Acts::Tagger::SingletonMethods
include ActiveRecord::Acts::Tagger::InstanceMethods

0 comments on commit bdd88b0

Please sign in to comment.