Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

date_select form helper fails with typed hstore #15

Open
Bahanix opened this issue Mar 24, 2014 · 0 comments · May be fixed by #16
Open

date_select form helper fails with typed hstore #15

Bahanix opened this issue Mar 24, 2014 · 0 comments · May be fixed by #16

Comments

@Bahanix
Copy link

Bahanix commented Mar 24, 2014

I am using activerecord-typedstore (0.4.3)

date_select form helper does not save data properly (display is ok).

http://api.rubyonrails.org/classes/ActionView/Helpers/DateHelper.html#method-i-date_select

class Foobar < ActiveRecord::Base
  typed_store :data, coder: DumbCoder do |s|
    s.date :birthdate
  end
end
<%= form_for @foobar do |f| %>
  <%= f.date_select :birthdate %>
  <%= f.submit %>
<% end %>
ActiveRecord::MultiparameterAssignmentErrors - 1 error(s) on assignment of multiparameter attributes [error on assignment [1989, 3, 24] to birthdate (undefined method `klass' for nil:NilClass)]:
  activerecord (4.0.4) lib/active_record/attribute_assignment.rb:79:in `execute_callstack_for_multiparameter_attributes'
  activerecord (4.0.4) lib/active_record/attribute_assignment.rb:63:in `assign_multiparameter_attributes'
  activerecord (4.0.4) lib/active_record/attribute_assignment.rb:34:in `assign_attributes'
  activerecord (4.0.4) lib/active_record/core.rb:468:in `init_attributes'
  activerecord (4.0.4) lib/active_record/core.rb:185:in `initialize'
  ...

It works well with a plain old date attribute.

Thanks for your work 🌻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant