Commits

Haru Iida committed 4202c2f

fixes #1245 conflict with redmine_tags_plugin.

Comments (0)

Files changed (3)

app/views/wiki_extensions/_tags_form.html.erb

 
 <%
    page = controller.wiki_extensions_get_current_page
-   tags = page.tags.sort { |a, b| a.name <=> b.name }
+   tags = page.wiki_ext_tags.sort { |a, b| a.name <=> b.name }
    baseurl = Redmine::Utils.relative_url_root
    img = baseurl + "/images/add.png"
 -%>

lib/wiki_extensions_tags_macro.rb

       return unless page
       project = page.project
 
-      return '' if page.tags.empty?
+      return '' if page.wiki_ext_tags.empty?
 
       o = '<ul class="wikiext-tags">'
-      page.tags.each{|tag|
+      page.wiki_ext_tags.each{|tag|
         o << '<li>' + link_to("#{tag.name}", {:controller => 'wiki_extensions',
               :action => 'tag', :id => project, :tag_id => tag.id}) + '</li>'
       }

lib/wiki_extensions_wiki_page_patch.rb

     base.class_eval do
       unloadable # Send unloadable so it will not be unloaded in development
       has_many :wiki_extensions_tag_relations, :dependent => :destroy
-      has_many :tags, :class_name => 'WikiExtensionsTag', :through => :wiki_extensions_tag_relations
+      has_many :wiki_ext_tags, :class_name => 'WikiExtensionsTag', :through => :wiki_extensions_tag_relations, :source => :tag
       has_one :wiki_extensions_count, :foreign_key => :page_id, :dependent => :destroy
       class << self
         # I dislike alias method chain, it's not the most readable backtraces