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

wrong number of arguments (1 for 0) #41

Open
alankirk opened this issue Nov 30, 2015 · 1 comment
Open

wrong number of arguments (1 for 0) #41

alankirk opened this issue Nov 30, 2015 · 1 comment

Comments

@alankirk
Copy link

I'm getting the above error message when clicking save from the crop image screen. I'm using the default form code for the preview / crop screen.

When hitting save I'm getting "wrong number of arguments (1 for 0)"

Looking at the error log, the error is being flagged on:

papercrop (0.3.0) lib/papercrop/model_extension.rb:124:inreprocess_cropped_attachment'`

Looking at that line the issue is in

if cropping?(attachment_name)

which looks like it should be expecting an argument, and the value of attachment_name is the correct attachment name.

I'm currently using Paperclip 4.2.1 (I've tried downgrading Paperclip to 3.4, just incase it was Paperclip issue, but still getting the error).

If you've any ideas to what the issue is or any suggestions to get to the root of the problem, they'd be most welcome.

Thanks

@fcarrega
Copy link

Hi there,

Just encountered the same issue, investigated and found that the problem comes from our own code and not from the gem.

Be careful to remove legacy methods from your code (such as cropping?) before using the gem, otherwise these methods will override the gem ones, which will cause the wrong number of arguments issue.

Cheers,

Fab'

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

No branches or pull requests

2 participants