-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update acts-as-taggable-on from 3.0.1 to 3.1.1
* This fixes the issue where the Mapping.with_traffic_summary scope would not chain with Mapping.tagged_with, generating invalid SQL when a `count` was required (falling over on `any?` and the like) * While we initially patched AATO ourselves, it turns out a fix was already merged for AATO 3.1.0 (mbleigh/acts-as-taggable-on#417) * 3.1.1 also had a tag counting performance improvement, which in truth doesn't do much for us but requires a migration
- Loading branch information
Showing
5 changed files
with
31 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
db/migrate/20140502114341_add_taggings_counter_cache_to_tags.acts_as_taggable_on_engine.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# This migration comes from acts_as_taggable_on_engine (originally 3) | ||
class AddTaggingsCounterCacheToTags < ActiveRecord::Migration | ||
def self.up | ||
add_column :tags, :taggings_count, :integer, :default => 0 | ||
|
||
ActsAsTaggableOn::Tag.reset_column_information | ||
ActsAsTaggableOn::Tag.find_each do |tag| | ||
ActsAsTaggableOn::Tag.reset_counters(tag.id, :taggings) | ||
end | ||
end | ||
|
||
def self.down | ||
remove_column :tags, :taggings_count | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters