uninitialized constant PublicActivity::ORM

366 Views Asked by At

I already have an table with name activities so I created public_activity.rb file with this line as some one suggested in an issue

PublicActivity::ORM::ActiveRecord::Activity.table_name = "notifications"

but when I try to run

rails g public_activity:migration notifications

it fails because of a name error uninitialized constant PublicActivity::ORM (NameError). Any one can resolve this error.

1

There are 1 best solutions below

0
On

There's an easier way to set a custom table name. Just put this in your initializer:

# config/initializers/public_activity.rb
PublicActivity.configure do |config|
  config.table_name = 'notifications'
end