ChiliProject is not maintained anymore. Please be advised that there will be no more updates.

We do not recommend that you setup new ChiliProject instances and we urge all existing users to migrate their data to a maintained system, e.g. Redmine. We will provide a migration script later. In the meantime, you can use the instructions by Christian Daehn.

Monkey patching with acts_as_journalized (development environment) (Bug #1148)


Added by Zach Hamman at 2012-09-19 08:26 pm. Updated at 2012-09-19 08:27 pm.


Status:Open Start date:2012-09-19
Priority:Normal Due date:
Assignee:- % Done:

0%

Category:-
Target version:-
Remote issue URL: Affected version:

Description

In Development Environment, no known issue in Production Environment
I am creating a plugin that would add journals to Version. When attempting to view activity or a user's page, the first view works fine, but a reload causes "Association :project not found". When I put my acts_as_journalized code in version.rb, the issue does not occur.

Code:

module CoreUpdate
    module VersionPatch
      def self.included(base)
        base.class_eval do
          acts_as_journalized :event_title => Proc.new{|o| "Milestone Update ##{o.version}"},
            :event_description => Proc.new{|o|
            str="" 
            o.details.each do |detail|
              str<<"#{o.render_detail(detail,true)}\n" 
            end
            str
          },
            :event_url => nil,
            :activity_permission=>:manage_milestones
        end
      end
    end
  end

Associated revisions

Revision 35321d93
Added by Jean-Philippe Lang at 2008-05-03 12:41 pm

Translations updates (closes #1128, #1129, #1135, #1148, #1163).

git-svn-id: http://redmine.rubyforge.org/svn/trunk@1409 e93f8b46-1217-0410-a6f0-8f06a7374b81

History

Updated by Zach Hamman at 2012-09-19 08:27 pm

I have also tried to use unloadable in the self.included and at the module level. No effect

Also available in: Atom PDF