Skip to content

Commit 8ede9aa

Browse files
committed
Migrate to Alchemy 4.1
Use the new Taggable module and remove cached_tag_list as this is not supported from Gutentag (the new tagging library Alchemy 4.1 now uses)
1 parent 87b090e commit 8ede9aa

7 files changed

Lines changed: 457 additions & 31 deletions

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)