Commit 4c1c340fd862c1f06d552f79c202cbaca6d8203c
Exists in
master
and in
27 other branches
Merge remote-tracking branch 'origin/master'
Showing
6 changed files
with
43 additions
and
5 deletions
Show diff stats
Gemfile
... | ... | @@ -2,7 +2,7 @@ source "https://rubygems.org" |
2 | 2 | gem 'rails', '~> 3.2.21' |
3 | 3 | gem 'minitest', '~> 3.2.0' |
4 | 4 | gem 'fast_gettext', '~> 0.6.8' |
5 | -gem 'acts-as-taggable-on', '~> 3.0.2' | |
5 | +gem 'acts-as-taggable-on', '~> 3.4.2' | |
6 | 6 | gem 'rails_autolink', '~> 1.1.5' |
7 | 7 | gem 'pg', '~> 0.13.2' |
8 | 8 | gem 'rmagick', '~> 2.13.1' | ... | ... |
db/migrate/20150116181243_add_taggings_counter_cache_to_tags.acts_as_taggable_on_engine.rb
0 → 100644
... | ... | @@ -0,0 +1,15 @@ |
1 | +# This migration comes from acts_as_taggable_on_engine (originally 3) | |
2 | +class AddTaggingsCounterCacheToTags < ActiveRecord::Migration | |
3 | + def self.up | |
4 | + add_column :tags, :taggings_count, :integer, default: 0 | |
5 | + | |
6 | + ActsAsTaggableOn::Tag.reset_column_information | |
7 | + ActsAsTaggableOn::Tag.find_each do |tag| | |
8 | + ActsAsTaggableOn::Tag.reset_counters(tag.id, :taggings) | |
9 | + end | |
10 | + end | |
11 | + | |
12 | + def self.down | |
13 | + remove_column :tags, :taggings_count | |
14 | + end | |
15 | +end | ... | ... |
db/migrate/20150116181244_add_missing_taggable_index.acts_as_taggable_on_engine.rb
0 → 100644
... | ... | @@ -0,0 +1,10 @@ |
1 | +# This migration comes from acts_as_taggable_on_engine (originally 4) | |
2 | +class AddMissingTaggableIndex < ActiveRecord::Migration | |
3 | + def self.up | |
4 | + add_index :taggings, [:taggable_id, :taggable_type, :context] | |
5 | + end | |
6 | + | |
7 | + def self.down | |
8 | + remove_index :taggings, [:taggable_id, :taggable_type, :context] | |
9 | + end | |
10 | +end | ... | ... |
db/schema.rb
... | ... | @@ -655,12 +655,14 @@ ActiveRecord::Schema.define(:version => 20150122165042) do |
655 | 655 | end |
656 | 656 | |
657 | 657 | add_index "taggings", ["tag_id", "taggable_id", "taggable_type", "context", "tagger_id", "tagger_type"], :name => "taggings_idx", :unique => true |
658 | + add_index "taggings", ["taggable_id", "taggable_type", "context"], :name => "index_taggings_on_taggable_id_and_taggable_type_and_context" | |
658 | 659 | add_index "taggings", ["taggable_id", "taggable_type"], :name => "index_taggings_on_taggable_id_and_taggable_type" |
659 | 660 | |
660 | 661 | create_table "tags", :force => true do |t| |
661 | 662 | t.string "name" |
662 | 663 | t.integer "parent_id" |
663 | - t.boolean "pending", :default => false | |
664 | + t.boolean "pending", :default => false | |
665 | + t.integer "taggings_count", :default => 0 | |
664 | 666 | end |
665 | 667 | |
666 | 668 | add_index "tags", ["name"], :name => "index_tags_on_name", :unique => true | ... | ... |
script/install-dependencies/debian-wheezy.sh
1 | -sources_entry='deb http://download.noosfero.org/debian/wheezy-1.1 ./' | |
1 | +binary_packages='deb http://download.noosfero.org/debian/wheezy-1.1 ./' | |
2 | 2 | |
3 | -if ! grep -q "$sources_entry" /etc/apt/sources.list.d/noosfero.list; then | |
3 | +source_packages=$(echo "$binary_packages" | sed -e 's/^deb/deb-src/') | |
4 | + | |
5 | +if ! grep -q "$binary_packages" /etc/apt/sources.list.d/noosfero.list; then | |
4 | 6 | sudo tee /etc/apt/sources.list.d/noosfero.list <<EOF |
5 | -$sources_entry | |
7 | +$binary_packages | |
8 | +$source_packages | |
6 | 9 | EOF |
7 | 10 | |
8 | 11 | sudo apt-key add - <<EOF | ... | ... |
test/unit/article_test.rb
1 | +# encoding: UTF-8 | |
1 | 2 | require_relative "../test_helper" |
2 | 3 | |
3 | 4 | class ArticleTest < ActiveSupport::TestCase |
... | ... | @@ -770,6 +771,13 @@ class ArticleTest < ActiveSupport::TestCase |
770 | 771 | assert_includes as, a |
771 | 772 | end |
772 | 773 | |
774 | + should 'get tagged with tag that contains special chars' do | |
775 | + a = create(Article, :name => 'Published at', :profile_id => profile.id, :tag_list => 'Métodos Ágeis') | |
776 | + as = Article.tagged_with('Métodos Ágeis') | |
777 | + | |
778 | + assert_includes as, a | |
779 | + end | |
780 | + | |
773 | 781 | should 'not get tagged with tag from other environment' do |
774 | 782 | article_from_this_environment = create(Article, :profile => profile, :tag_list => 'bli') |
775 | 783 | ... | ... |