Closed rpalackas closed 2 months ago
I've resolved the issue locally and created a PR with my fix here: https://github.com/railsadminteam/rails_admin/pull/3555 I know your contributions page requests specs for the issue however I followed the contributions guide to setup and run specs locally and they're all failing with:
An error occurred while loading ./spec/integration/fields/wysihtml5_spec.rb. - Did you mean?
rspec ./spec/integration/fields/time_spec.rb
rspec ./spec/integration/fields/enum_spec.rb
rspec ./spec/integration/fields/simple_mde_spec.rb
Failure/Error: require 'sprockets/railtie'
LoadError:
cannot load such file -- sprockets/railtie
# ./spec/dummy_app/config/application.rb:22:in `require'
# ./spec/dummy_app/config/application.rb:22:in `<top (required)>'
# ./spec/dummy_app/config/environment.rb:4:in `require'
# ./spec/dummy_app/config/environment.rb:4:in `<top (required)>'
# ./spec/spec_helper.rb:30:in `require'
# ./spec/spec_helper.rb:30:in `<top (required)>'
# ./spec/integration/fields/wysihtml5_spec.rb:3:in `require'
# ./spec/integration/fields/wysihtml5_spec.rb:3:in `<top (required)>'
/Users/richardpalackas/rails_admin/spec/spec_helper.rb:5: warning: already initialized constant CI_ORM
/Users/richardpalackas/rails_admin/spec/spec_helper.rb:5: warning: previous definition of CI_ORM was here
/Users/richardpalackas/rails_admin/spec/spec_helper.rb:6: warning: already initialized constant CI_TARGET_ORMS
/Users/richardpalackas/rails_admin/spec/spec_helper.rb:6: warning: previous definition of CI_TARGET_ORMS was here
/Users/richardpalackas/rails_admin/spec/spec_helper.rb:7: warning: already initialized constant PK_COLUMN
/Users/richardpalackas/rails_admin/spec/spec_helper.rb:7: warning: previous definition of PK_COLUMN was here
feel free to update the PR to meet your requirements
Please refer to CONTRIBUTING.md, which got updated recently.
Sorry it's been so long since I updated this. Finally had some time to work on the specs
Fixed by #3555.
Describe the bug When a mongoid document has an embedded class the boolean selector doesn't work on new or edit
Reproduction steps Create mongoid class with embedded document Embedded document needs to have a Mongoid::Boolean field Add the embedded document in accepts_nested_attributes_for Open edit or create for the parent document in rails admin Clicking any of the buttons for the boolean won't change your selection
Expected behavior Clicking the buttons will change the selection
Additional context Digging into the html it seems to be that the label field has an incorrect for value: What rails admin creates:
What it should be:
manually updating that label tag for attribute via admin tools fixes the problem.
rails
version: 6.1.6.1rails_admin
version: 3.0.0mongoid
version: 7.5.1