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

stack level too deep when mount on a column named "file" #103

Closed
wants to merge 1 commit into from
Closed

stack level too deep when mount on a column named "file" #103

wants to merge 1 commit into from

Conversation

plentz
Copy link

@plentz plentz commented Oct 6, 2013

If you have you uploader mounted on a column named file, like this:

class Attachment < ActiveRecord::Base
  attr_accessible :name, :file, :size, :attachable_id, :attachable_type, :content_type
  mount_uploader :file, AttachmentUploader
  ... 
end

You will see a SystemStackError (stack level too deep) when trying to use create, like this:

Attachment.new(params[:attachment])

It's the same problem related in #10 and #18. I don't know why they closed the other issues, when it's clearly a problem in the gem(in my opinion), since it works with regular carrierwave(and it's pretty hard for a user to figure it out).

@plentz
Copy link
Author

plentz commented Oct 6, 2013

@dwilkie I think my solution is pretty straightforward - and the tests are green. Please merge it if you think it's ok or comment what you think I can change to meet with your requirements. Thanks in advance

@plentz plentz mentioned this pull request Oct 6, 2013
@dwilkie
Copy link
Owner

dwilkie commented Oct 7, 2013

@plentz let's just wait for @nddeluca to take a look, he's actively maintaining this gem.

@plentz
Copy link
Author

plentz commented Oct 8, 2013

@nddeluca it's up to you :)

@nddeluca
Copy link
Collaborator

nddeluca commented Oct 8, 2013

@plentz Thanks for solving this! I'm in the process of playing around with this in a rails app. Also, is it possible to add a test so we don't accidentally break this again later?

@plentz
Copy link
Author

plentz commented Oct 10, 2013

@nddeluca I will try to add a test for this and I ping you when it's done.

@nddeluca
Copy link
Collaborator

Awesome, thanks!

hasghari pushed a commit to g2crowd/carrierwave_direct that referenced this pull request Oct 17, 2013
@plentz
Copy link
Author

plentz commented Oct 19, 2013

@nddeluca hey! Just a quick update on this. I just found that the order of things change the behavior! I think we can find a better solution to this problem, since this fails:

  attr_accessible :file
  mount_uploader :file, AttachmentUploader

But this works:

  mount_uploader :file, AttachmentUploader
  attr_accessible :file

I will look further.

@mois3x
Copy link
Contributor

mois3x commented Jun 23, 2014

@plentz why this hasn't been merged? I used this gem and i get that same bug :S what's the problem then?

@plentz
Copy link
Author

plentz commented Jun 23, 2014

@mois3x I didn't created a test to ensure that we don't break this again. If you want to write a test to it, you can make a pull request to my repository https://github.com/plentz/carrierwave_direct and then we merge this alltogheter.

@mois3x
Copy link
Contributor

mois3x commented Jun 23, 2014

@plents , could update your repo? i made the test in the updated fork of my repo. anyway i'll make you a pull request and u tellme if i have to do something more again

@sunny
Copy link

sunny commented Jan 27, 2015

👍 The patch fixes the issue here as well.

@p8 p8 changed the title stack level too deep when mount on a collumn named "file" stack level too deep when mount on a column named "file" Apr 1, 2015
fabn added a commit to fabn/carrierwave_direct that referenced this pull request Oct 13, 2015
@fabn
Copy link
Collaborator

fabn commented Oct 13, 2015

Applied in #188.

@fabn fabn closed this Oct 13, 2015
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 this pull request may close these issues.

6 participants