werein / x-editable-rails

Edit fields easily with X-Editable helper
https://wereinhq.com/guides/x-editable-rails
MIT License
155 stars 87 forks source link

Latest version 1.5.4 breaks Rails 4.1 compatibility #57

Closed zedalaye closed 9 years ago

zedalaye commented 9 years ago

See 8902722545d66bfad9cef8e25e0f6aa4d49acdb3

In Rails 3.0 -> 4.1 there is no way to call model_name on an ActiveRecord instance. This is only possible in Rails 4.2

The solution is to add ".class" before ".model_name" this should work in all cases since from Rails 4.2 the call to ".model_name" is delegated to the instance class.

https://github.com/rails/rails/blob/4-2-stable/activemodel/lib/active_model/naming.rb#L220

jirikolarik commented 9 years ago

Can you try if the solutions you proposed works? I don't use it anymore, so I would have to setup new app with this gem which could have take some time..

zedalaye commented 9 years ago

Yes it work. Both in Rails 4.1 and in Rails 4.2

jirikolarik commented 9 years ago

Fixed by @laserlemon in #58