Skip to content

Upgrading from pre 0.4.0 versions

Piotrek Okoński edited this page Jul 7, 2013 · 1 revision

Read this if you have been using versions older than 0.4.

There are a couple of major differences between 0.3 and 0.4 version. To upgrade, follow these steps:

  1. Add include PublicActivity::Model above tracked method call in your tracked models, like this:

    ActiveRecord:

    class Article < ActiveRecord::Base
      include PublicActivity::Model
      tracked
    end

    Mongoid:

    class Article
      include Mongoid::Document
      include PublicActivity::Model
      tracked
    end
  2. public_activity's config YAML file is no longer used (by default in config/pba.yml). Move your YAML contents to your config/locales/*.yml files.


    IMPORTANT: Locales are no longer rendered with ERB, this has been removed in favor of real view partials like in actual Rails apps. Read Activity views section above to learn how to use those templates.

  3. (ActiveRecord only) Generate and run migration which adds new column to activities table:

    rails g public_activity:migration_upgrade
    rake db:migrate