Rails_admin ignores Rails message with key restrict_dependent_destroy (See this)
Example:
Country model:
class Country < ApplicationRecord
has_many :cities, dependent: :restrict_with_error
end
If you try to destroy country with cities inside irb:
irb(main):001:0> c = Country.first
irb(main):002:0> c.destroy
(1.0ms) ROLLBACK
irb(main):003:0> c.errors.messages
=> {:base=>["Cannot delete record because dependent cities exist"]}
If we try to delete the country via rails_admin we only got an abstract message:
Country failed to be deleted
Rails_admin should use full error message because an admin have to know what is wrong.
Rails_admin ignores Rails message with key
restrict_dependent_destroy(See this)Example:
Countrymodel:If you try to destroy country with cities inside irb:
If we try to delete the country via rails_admin we only got an abstract message:
Country failed to be deletedRails_admin should use full error message because an admin have to know what is wrong.