noosfero | 3 new commits pushed to repository

Antonio Terceiro gitlab at gitlab.com
Fri Feb 27 11:06:53 BRT 2015


Antonio Terceiro pushed to refs/heads/master at <a href="https://gitlab.com/noosfero/noosfero">Noosfero / noosfero</a>

Commits:
<a href="https://gitlab.com/noosfero/noosfero/commit/09330524bb6dfe87bdca6092ddd050c461971b5d">09330524</a> by Antonio Terceiro
debian: make source packages available as well

- - - - -
<a href="https://gitlab.com/noosfero/noosfero/commit/f5ff10a3298606c1988f01cf91583c679986b6e0">f5ff10a3</a> by Victor Costa
Update version of acts-as-taggable-on

See merge request !421

Signed-off-by: Victor Costa <vfcosta at gmail.com>
Signed-off-by: Antonio Terceiro <terceiro at colivre.coop.br>

- - - - -
<a href="https://gitlab.com/noosfero/noosfero/commit/c5b5a2967b1c05e55942e370e1ada734f78a1a3b">c5b5a296</a> by Antonio Terceiro
db/schema.rb: update

- - - - -


Changes:

=====================================
Gemfile
=====================================
--- a/Gemfile
+++ b/Gemfile
@@ -2,7 +2,7 @@ source "https://rubygems.org"
 gem 'rails',                    '~> 3.2.21'
 gem 'minitest',                 '~> 3.2.0'
 gem 'fast_gettext',             '~> 0.6.8'
-gem 'acts-as-taggable-on',      '~> 3.0.2'
+gem 'acts-as-taggable-on',      '~> 3.4.2'
 gem 'rails_autolink',           '~> 1.1.5'
 gem 'pg',                       '~> 0.13.2'
 gem 'rmagick',                  '~> 2.13.1'

=====================================
db/migrate/20150116181243_add_taggings_counter_cache_to_tags.acts_as_taggable_on_engine.rb
=====================================
--- /dev/null
+++ b/db/migrate/20150116181243_add_taggings_counter_cache_to_tags.acts_as_taggable_on_engine.rb
@@ -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

=====================================
db/migrate/20150116181244_add_missing_taggable_index.acts_as_taggable_on_engine.rb
=====================================
--- /dev/null
+++ b/db/migrate/20150116181244_add_missing_taggable_index.acts_as_taggable_on_engine.rb
@@ -0,0 +1,10 @@
+# This migration comes from acts_as_taggable_on_engine (originally 4)
+class AddMissingTaggableIndex < ActiveRecord::Migration
+  def self.up
+    add_index :taggings, [:taggable_id, :taggable_type, :context]
+  end
+
+  def self.down
+    remove_index :taggings, [:taggable_id, :taggable_type, :context]
+  end
+end

=====================================
db/schema.rb
=====================================
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -655,12 +655,14 @@ ActiveRecord::Schema.define(:version => 20150122165042) do
   end
 
   add_index "taggings", ["tag_id", "taggable_id", "taggable_type", "context", "tagger_id", "tagger_type"], :name => "taggings_idx", :unique => true
+  add_index "taggings", ["taggable_id", "taggable_type", "context"], :name => "index_taggings_on_taggable_id_and_taggable_type_and_context"
   add_index "taggings", ["taggable_id", "taggable_type"], :name => "index_taggings_on_taggable_id_and_taggable_type"
 
   create_table "tags", :force => true do |t|
     t.string  "name"
     t.integer "parent_id"
-    t.boolean "pending",   :default => false
+    t.boolean "pending",        :default => false
+    t.integer "taggings_count", :default => 0
   end
 
   add_index "tags", ["name"], :name => "index_tags_on_name", :unique => true

=====================================
script/install-dependencies/debian-wheezy.sh
=====================================
--- a/script/install-dependencies/debian-wheezy.sh
+++ b/script/install-dependencies/debian-wheezy.sh
@@ -1,8 +1,11 @@
-sources_entry='deb http://download.noosfero.org/debian/wheezy-1.1 ./'
+binary_packages='deb http://download.noosfero.org/debian/wheezy-1.1 ./'
 
-if ! grep -q "$sources_entry" /etc/apt/sources.list.d/noosfero.list; then
+source_packages=$(echo "$binary_packages" | sed -e 's/^deb/deb-src/')
+
+if ! grep -q "$binary_packages" /etc/apt/sources.list.d/noosfero.list; then
   sudo tee /etc/apt/sources.list.d/noosfero.list <<EOF
-$sources_entry
+$binary_packages
+$source_packages
 EOF
 
   sudo apt-key add - <<EOF

=====================================
test/unit/article_test.rb
=====================================
--- a/test/unit/article_test.rb
+++ b/test/unit/article_test.rb
@@ -1,3 +1,4 @@
+# encoding: UTF-8
 require_relative "../test_helper"
 
 class ArticleTest < ActiveSupport::TestCase
@@ -770,6 +771,13 @@ class ArticleTest < ActiveSupport::TestCase
     assert_includes as, a
   end
 
+  should 'get tagged with tag that contains special chars' do
+    a = create(Article, :name => 'Published at', :profile_id => profile.id, :tag_list => 'Métodos Ágeis')
+    as = Article.tagged_with('Métodos Ágeis')
+
+    assert_includes as, a
+  end
+
   should 'not get tagged with tag from other environment' do
     article_from_this_environment = create(Article, :profile => profile, :tag_list => 'bli')
 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listas.softwarelivre.org/pipermail/noosfero-dev/attachments/20150227/8e182e97/attachment.html>


More information about the Noosfero-dev mailing list