Top Menu

Jump to content
Home
    Modules
      • Projects
      • Activity
      • Work packages
      • Gantt charts
      • Calendars
      • Team planners
      • Boards
      • News
    • Getting started
    • Introduction video
      Welcome to OpenProject Community
      Get a quick overview of project management and team collaboration with OpenProject. You can restart this video from the help menu.

    • Help and support
    • Upgrade to Enterprise edition
    • User guides
    • Videos
    • Shortcuts
    • Community forum
    • Enterprise support

    • Additional resources
    • Data privacy and security policy
    • Digital accessibility (DE)
    • OpenProject website
    • Security alerts / Newsletter
    • OpenProject blog
    • Release notes
    • Report a bug
    • Development roadmap
    • Add and edit translations
    • API documentation
  • Sign in
      Forgot your password?

      or sign in with your existing account

      Google

Side Menu

  • Overview
  • Activity
    Activity
  • Roadmap
  • Work packages
    Work packages
  • Gantt charts
    Gantt charts
  • Calendars
    Calendars
  • Team planners
    Team planners
  • Boards
    Boards
  • News
  • Forums

Content

Support Installation & Updates
  1. OpenProject
  2. Forums
  3. Support Installation & Updates
  4. Redmine/chiliproject migration problems - "changes is defined by ActiveRecord" ActiveRecord::DangerousAttributeError

Redmine/chiliproject migration problems - "changes is defined by ActiveRecord" ActiveRecord::DangerousAttributeError

Added by Denis Lamotte over 11 years ago

Hi all,
i have decide to convert a few redmine and chiliproject to openproject the latest branch.

i use the latest version of openproject 3 with all the following plugins:

Gemfile.plugins
gem "openproject-plugins", :git => "https://github.com/opf/openproject-plugins.git", :branch => "dev"
gem "openproject-meeting", git: "https://github.com/finnlabs/openproject-meeting.git", :branch => "dev"
gem "openproject-pdf_export", git: "https://github.com/finnlabs/openproject-pdf_export", :branch => "dev"
gem "openproject-backlogs", git: "https://github.com/finnlabs/openproject-backlogs.git", :branch => "dev"
gem "pdf-inspector", "~>1.0.0"
gem "openproject-global_roles", git: "https://github.com/finnlabs/openproject-global_roles.git", :branch => "dev"
gem "openproject-costs", git: "https://github.com/finnlabs/openproject-costs.git", :branch => "dev"
gem "prawn"

i have no problem with the bundle or whatosever, the seeded project seems to work fine. BUT
The migration from the existing data does not work, so i begin to create my own sql migration file to match all table generated after a standard migration.

Most of the projects works except when i try o update a work_package i receive the following error:

*ActiveRecord::DangerousAttributeError in WorkPackagesController#update*

changes is defined by ActiveRecord

app/models/journal_manager.rb:154:in `create_journal'
app/models/journal_manager.rb:137:in `add_journal'
lib/plugins/acts_as_journalized/lib/redmine/acts/journalized/save_hooks.rb:69:in `save_journals'
app/models/work_package.rb:423:in `update_by!'
app/controllers/work_packages_controller.rb:181:in `update'

i’m using ruby-2.0.0-p247 with rails 3.2.16 and all gemset defined in the Gemfile.

i add the full stack trace, the migration file i apply on the original chili project dump and the resulting dump struct.

Any idea cause i’m stuck there :-) !!

Best regards


Replies (2)

RE: Redmine/chiliproject migration problems - "changes is defined by ActiveRecord" ActiveRecord::DangerousAttributeError - Added by Martin Linkhorst over 11 years ago

hi Denis,

since you are migrating an old plugin I’m confident that your issue has to do with OpenProject renaming the `changes` attribute to `changed_data` due to naming conflicts with ActiveRecord. The relevant commit is here: https://github.com/opf/openproject/commit/70a63a6
what you need to do: you basically need to rename all occurrences of `Journal#changes` to `Journal#changed_data`. Usually the `changed_data` attribute is filtered out in `create_journal`, see here https://github.com/opf/openproject/blob/dev/app/models/journal_manager.rb#L145
but since you are providing the old `#changes` attribute, it’s not filtered out and passed directly to ActiveRecord which doesn’t like it (anymore).

if you have no control over the naming of the `changes` attribute, then we probably need additional information about the plugin you’re migrating in order to help you more.

Thanks for your effort of migrating plugins to OpenProject! That’s very cool and you can expect further support here in the forums.

RE: Redmine/chiliproject migration problems - "changes is defined by ActiveRecord" ActiveRecord::DangerousAttributeError - Added by Denis Lamotte over 11 years ago

Thanks :-)

  • (1 - 2/2)
Loading...