Use scopes for better query performance
This commit is contained in:
@@ -1 +0,0 @@
|
||||
require 'active_record_extensions'
|
||||
@@ -44,7 +44,7 @@ module ActsAsTaggableOn
|
||||
ActsAsTaggableOn::Tag.where('taggings.taggable_type' => 'SpendingProposal').includes(:taggings).order(:name).uniq
|
||||
end
|
||||
|
||||
def self.public_for_api
|
||||
scope :public_for_api, -> do
|
||||
find_by_sql(%|
|
||||
SELECT *
|
||||
FROM tags
|
||||
|
||||
Reference in New Issue
Block a user