janko / rodauth-rails

Rails integration for Rodauth authentication framework
https://github.com/jeremyevans/rodauth
MIT License
565 stars 40 forks source link

Use `attributes_before_type_cast` in `Rodauth::Rails.rodauth` (#292) #293

Closed dush closed 2 months ago

dush commented 2 months ago

Do not type cast ActiveRecord model instance attributes in instance returned from Rodauth::Rails.rodauth. Fixes problems with integer status column values being typecasted to string values by enum definition in Account model.

janko commented 2 months ago

Thanks for the PR! There is a test failure in Ruby 3.2 & Rails 6.1, but I couldn't reproduce it locally. Hopefully it's a fluke, I'll just go ahead and merge this.