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
{{ message }}
Repository navigation
[Bug] After v3.1.0 using attributes name for attr_accessor in Form Objects breaks #96
This may not be a bug that needs to be fixed, but it caused issues in production for us that were uncaught by our unit tests.
Bug report:
We have multiple form objects where we used something like this:
class RegistrationForm < YAAF::Form
attr_accessor :attributes
def initialize(attributes)
super(attributes)
@models = [user]
end
def user
@user ||= User.new(attributes)
end
end
Note that we use attributes as the name for the attr_accessor (in your docs example you use user_attributes.
This caused issues in production that raise errors like:
ActionView::Template::Error: undefined method 'fetch_value' for an instance of ActiveSupport::HashWithIndifferentAccess
I think we will proceed to rename all references to attributes for something like form_attributes and that should solve it. But opening a ticket to let you know about this issue.
@andresg4 can you check it out? I guess that adding ActiveModel::Attributes caused this.
@sebaherrera07 any suggestion on what would be the solution here? I'm thinking that the best option is adding a warning in our README that the name attributes is reserved by Rails?
@santib yes it's caused by the addition of ActiveModel::Attributes. I already added a warning in the release notes, and planned to add one to the readme too. As far as I could check this would be the best option
@andresg4 can you check it out? I guess that adding ActiveModel::Attributes caused this.
@sebaherrera07 any suggestion on what would be the solution here? I'm thinking that the best option is adding a warning in our README that the name attributes is reserved by Rails?
@santib Agree with you, I don't expect the gem to be modified, maybe just a warning in the README and the release notes for that version would be good.
Activity
santib commentedon Feb 11, 2026
@andresg4 can you check it out? I guess that adding
ActiveModel::Attributescaused this.@sebaherrera07 any suggestion on what would be the solution here? I'm thinking that the best option is adding a warning in our README that the name
attributesis reserved by Rails?andresg4 commentedon Feb 11, 2026
@santib yes it's caused by the addition of
ActiveModel::Attributes. I already added a warning in the release notes, and planned to add one to the readme too. As far as I could check this would be the best optionsebaherrera07 commentedon Feb 11, 2026
@santib Agree with you, I don't expect the gem to be modified, maybe just a warning in the README and the release notes for that version would be good.
santib commentedon Feb 11, 2026
thanks for letting us know 😄 🙌