sneaky-save icon indicating copy to clipboard operation
sneaky-save copied to clipboard

Rails 5 - undefined method `arel_attributes_with_values_for_create'

Open cryptomatictrader opened this issue 6 years ago • 5 comments

Anyone is using this gem with Rails 5? It looks like Rails 5 AR doesn't have "arel_attributes_with_values_for_create" anymore and thus it's broken.

Any suggestion?

[2018-08-23 10:08:54.327799 #22071] ERROR: undefined method `arel_attributes_with_values_for_create' for #<Candy:0x00007fd047782fe8>
[2018-08-23 10:08:54.328175 #22071] ERROR: /Users/calvin/.rvm/gems/ruby-2.5.1/gems/activemodel-5.2.1/lib/active_model/attribute_methods.rb:430:in `method_missing'
/Users/calvin/.rvm/gems/ruby-2.5.1/gems/sneaky-save-0.1.3/lib/sneaky-save.rb:87:in `sneaky_attributes_values'
/Users/calvin/.rvm/gems/ruby-2.5.1/gems/sneaky-save-0.1.3/lib/sneaky-save.rb:45:in `sneaky_create'
/Users/calvin/.rvm/gems/ruby-2.5.1/gems/sneaky-save-0.1.3/lib/sneaky-save.rb:33:in `sneaky_create_or_update'
/Users/calvin/.rvm/gems/ruby-2.5.1/gems/sneaky-save-0.1.3/lib/sneaky-save.rb:16:in `sneaky_save'

cryptomatictrader avatar Aug 23 '18 18:08 cryptomatictrader

We'll figure this out soon

einzige avatar Aug 24 '18 11:08 einzige

Is there a workaround for this?

robklassy avatar Jul 31 '19 15:07 robklassy

any updates here @einzige

tushar0837 avatar Nov 06 '20 11:11 tushar0837

im having the same error Is there a fix for this? rails 5 ruby 2.6

yossiedri avatar Aug 09 '22 09:08 yossiedri

@yossiedri I don't think there is a fix, I basically had to write the method myself to make it work

robklassy avatar Aug 13 '22 22:08 robklassy