You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Because I'm currently working with a legacy database, I have setup a table name prefix in config/application.rb.
ActiveRecord::Base.table_name_prefix='prefix_'
It appears that ActiveAdmin does not pickup on that, which result in a Mysql error when trying to display the index page of the Comment resource or any individual resources:
Expected behavior
ActiveAdmin should detect that a prefix has been set on ActiveRecord and use it when retrieving admin comments.
Actual behavior
I think that since table_name is set /lib/active_admin/orm/active_record/comments/comment.rb the table_name_prefix is discarded.
ActiveRecord::StatementInvalid in Admin::CommentsController#index
Mysql2::Error: Table 'database.active_admin_comments' doesn't exist: SHOW FULL FIELDS FROM `active_admin_comments`
I'll see if this work tomorrow and if yes I'll create a pull request.
PS: Note same thing is happening for the suffix.
The text was updated successfully, but these errors were encountered:
Techbrunch
changed the title
table_name_prefix not taken into account for active_admin_comments
table name prefix & suffix not taken into account for active_admin_comments
Jul 23, 2017
Techbrunch
pushed a commit
to Techbrunch/activeadmin
that referenced
this issue
Jul 23, 2017
Because I'm currently working with a legacy database, I have setup a table name prefix in
config/application.rb
.It appears that ActiveAdmin does not pickup on that, which result in a Mysql error when trying to display the index page of the
Comment
resource or any individual resources:Expected behavior
ActiveAdmin should detect that a prefix has been set on ActiveRecord and use it when retrieving admin comments.
Actual behavior
I think that since
table_name
is set/lib/active_admin/orm/active_record/comments/comment.rb
thetable_name_prefix
is discarded.Suggested fix
Something like:
I'll see if this work tomorrow and if yes I'll create a pull request.
PS: Note same thing is happening for the suffix.
The text was updated successfully, but these errors were encountered: