drapergem / draper

Decorators/View-Models for Rails Applications
MIT License
5.22k stars 527 forks source link

draper doesn't work with ActiveModelSerializer 0.9.3 #644

Closed tricknotes closed 9 years ago

tricknotes commented 9 years ago

I caught the following error:

/Users/tricknotes/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/draper-1.4.0/lib/draper/railtie.rb:48:in `block (2 levels) in <class:Railtie>': uninitialized constant ActiveModel::ArraySerializerSupport (NameError)

see: https://github.com/drapergem/draper/blob/v1.4.0/lib/draper/railtie.rb#L48

Work versions:

Doesn't work version:

tricknotes commented 9 years ago

I have the following work around:

# Gemfile
gem 'draper', require: false

# config/application.rb
require 'draper'
Draper::Railtie.initializers.delete_if {|initializer| initializer.name == 'draper.setup_active_model_serializers' }

It works as my expectation. (But some draper's feature is probably dropped.)

tricknotes commented 9 years ago

It seems AMS 0.9.1 is yanked https://github.com/rails-api/active_model_serializers/commit/97c9c5084a1531e086848e4d75fc90145fba9b83 . Current latest stable version 0.9.2 works fine.

But 0-9-stable branch doesn't work due to undefined constant ActiveModel::ArraySerializerSupport. So I update title of this PR.

jasonayre commented 9 years ago

@tricknotes Are you saying Draper is working for you with 9.2 version of AMS? Because I am getting this same error with 9.2

sethherr commented 9 years ago

Me too :+1: (and AMS 9.3)

savroff commented 9 years ago

Last working version is 0.9.0

EverybodyKurts commented 9 years ago

Receiving the same error.

savroff commented 9 years ago

@KurtRMueller on version 0.9.0 you still have error?

EverybodyKurts commented 9 years ago

Hey @savroff, after reverting back to 0.9.0, I no longer receive the error.

stevenharman commented 9 years ago

I have addressed this in #596, which I'm going to rebase atop the latest master and hopefully we can get it merged.

lucascaton commented 9 years ago

Hi there. Any news on this one? Thanks.

iRet commented 9 years ago

Same error on 0.9.3 :squirrel:

nirnaeth commented 9 years ago

we are having this error with 0.9.3, too. but for other colleagues that have 0.9.0 it works perfectly fine.

arpitadhundia commented 9 years ago

We have the same issue that we discovered during Rails4.2 upgrade. 0.9.3 gives this error, while 0.9.0 does not. Though 0.9.0 has another big bug https://github.com/rails-api/active_model_serializers/issues/746, which is affecting us now. Any idea when will a fix for the draper issue be released? So that we can have a version which has both these bugs fixed?

lucascaton commented 9 years ago

Hi @drapergem, any news on this one? Thanks.

tboyko commented 9 years ago

+1

bigardone commented 9 years ago

+1

themire commented 9 years ago

+1

fzf commented 9 years ago

+1

deefour commented 9 years ago

I'll jump on board too. +1

I currently use @stevenharman's fork.

ExReanimator commented 9 years ago

+1

kmarshall008 commented 9 years ago

+1

atipugin commented 9 years ago

+1

mr-dxdy commented 9 years ago

+1

pecha7x commented 9 years ago

+1

rossettistone commented 9 years ago

+1

tboyko commented 9 years ago

Pull request patch fixes the issue for me.

+1

jcasimir commented 9 years ago

Please try 2.0 and reopen if the problem pops up again.

deefour commented 9 years ago

:heart: thank you @jcasimir

tricknotes commented 9 years ago

It works fine for me. Thanks :whale:

jcasimir commented 9 years ago

Sweet!

kmarshall008 commented 9 years ago

This is going to be so helpful for us... I'm so glad we trusted you'd get this sorted and worked on some other items the past few weeks. Thanks for getting this all figured out so quickly.

On Thu, Mar 26, 2015 at 10:22 PM, Jeff Casimir notifications@github.com wrote:

Sweet!

— Reply to this email directly or view it on GitHub https://github.com/drapergem/draper/issues/644#issuecomment-86828967.