I have a has_and_belongs_to_many association between my Activity model and Photo Model.
class Activity < ActiveRecord::Base
has_and_belongs_to_many :photos, -> { where(photos: { deleted: false })}
end
class Photo < ActiveRecord::Base
has_and_belongs_to_many :activities
end
I have installed rails_admin for creating the admin pages for these models.
However when I try to access the 'admin/activity/new' page I get an error:
wrong number of arguments (1 for 0)
on the line where the has_and_belongs_to_many association is defined for photos.
When I remove the where condition from the association I am able to access the 'admin/activity/new'.
Is there any problem with where conditions on the has_and_belongs_to_many association with rails_admin or am I doing something wrong??