Skip to content

Commit 7931ae2

Browse files
authored
Merge pull request #66 from tvdeyen/gutentags
Use Alchemy's Taggable module
2 parents 67e25fe + 8ede9aa commit 7931ae2

8 files changed

Lines changed: 458 additions & 33 deletions

Rakefile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,7 @@ namespace :alchemy do
3333
system <<-BASH
3434
cd spec/dummy
3535
export RAILS_ENV=test
36-
bin/rake db:environment:set
37-
bin/rake db:migrate:reset
36+
bin/rake db:create db:environment:set db:migrate
3837
bin/rails g alchemy:devise:install --force
3938
cd -
4039
BASH

app/models/alchemy/user.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
require 'devise/orm/active_record'
2-
require 'acts-as-taggable-on'
32
require 'userstamp'
43

54
module Alchemy
@@ -19,8 +18,7 @@ class User < ActiveRecord::Base
1918

2019
devise *Alchemy.devise_modules
2120

22-
acts_as_taggable
23-
acts_as_tagger
21+
include Alchemy::Taggable
2422

2523
attr_accessor :send_credentials
2624

spec/dummy/db/migrate/20141119205157_add_taggings_counter_cache_to_tags.alchemy.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ class AddTaggingsCounterCacheToTags < ActiveRecord::Migration[4.2]
33
def self.up
44
add_column :tags, :taggings_count, :integer, default: 0
55

6+
# inserted by Alchemy CMS upgrader
7+
return unless defined?(ActsAsTaggableOn)
8+
69
ActsAsTaggableOn::Tag.reset_column_information
710
ActsAsTaggableOn::Tag.find_each do |tag|
811
ActsAsTaggableOn::Tag.reset_counters(tag.id, :taggings)

spec/dummy/db/migrate/20160518190427_change_collation_for_tag_names.acts_as_taggable_on_engine.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
# work properly
44
class ChangeCollationForTagNames < ActiveRecord::Migration[4.2]
55
def up
6+
# inserted by Alchemy CMS upgrader
7+
return unless defined?(ActsAsTaggableOn)
8+
69
if ActsAsTaggableOn::Utils.using_mysql?
710
execute("ALTER TABLE tags MODIFY name varchar(255) CHARACTER SET utf8 COLLATE utf8_bin;")
811
end
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
class RemoveCachedTagListFromAlchemyUsers < ActiveRecord::Migration[5.0]
2+
def change
3+
remove_column :alchemy_users, :cached_tag_list, :text
4+
end
5+
end

0 commit comments

Comments
 (0)