has_moderated icon indicating copy to clipboard operation
has_moderated copied to clipboard

Rails 4 Compatibility

Open arowla opened this issue 12 years ago • 2 comments

This library seems to be incompatible with Rails 4. Is anyone working on an update? Updating the gem to Rails 4 and running the specs results in a whole lot of:

 ActiveRecord::StatementInvalid:
   TypeError: can't cast Hash to text: INSERT INTO "moderations" ("created_at", "data", "moderatable_id", "moderatable_type", "updated_at") VALUES (?, ?, ?, ?, ?)

I've spent some time today trying to fix it, but haven't yet come up with a workable solution. It would help to be clear on the relevant part of ActiveRecord (or other module) that changed from Rails 3 to 4, but looking through the Release Notes and Changelog hasn't yielded any smoking guns.

arowla avatar Sep 13 '13 19:09 arowla

Hey. Yeah I would definitely expect it to break under Rails 4, since the gem works a lot with Rails internal things. I will try to look at it when I find some free time, currently I am pretty busy with a few projects. Of course in the meantime I would gladly accept any pull requests related to this. We can opt for a Rails 4-only version.

As far as the changes you are asking for, many of them are probably not described in official changelog/release notes as some of them are internal methods, so the Rails team has no obligation to not change them or report on changes for them. The easiest way to figure it out is basically to watch for errors in specs and then bundle open active_record to see what changed. Sorry that I cannot help more right now

mrbrdo avatar Sep 13 '13 20:09 mrbrdo

Any activity at all on this issue or is this gem pretty much dead?

shaimo avatar Apr 07 '16 19:04 shaimo