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

attachement_fu and rails 3.0 #10

Open
ippa opened this issue Feb 12, 2010 · 4 comments
Open

attachement_fu and rails 3.0 #10

ippa opened this issue Feb 12, 2010 · 4 comments

Comments

@ippa
Copy link

ippa commented Feb 12, 2010

When I use my old proven attachement_fu setup from rails 2.x projects in a new rails 3.0 project I run into a problem with this line:

@image = @owner.images.create!(:uploaded_data => @DaTa)

The error is "unknown attribute: uploaded_data"

@ippa
Copy link
Author

ippa commented Feb 12, 2010

Scrap the above, was due to a brainmeltdown. Now I seem to have run into something real though:

NoMethodError (undefined method `callback' for #Image:0x7fb12eef2f40):

This error seems to trigger right after the whole image has been uploaded.
Smells active record 3.0 ...

@dmann
Copy link

dmann commented Mar 26, 2010

It looks like ActiveRecord::Callbacks has changed a bunch in Rails 3. The callback method that attachment_fu is trying to call was a private method and looks like it was removed with the following commit:

http://github.com/rails/rails/commit/4f37b97033f596ec2c95eb53e9964e051c224981#L10L360

I don't actually use the after_attachment_saved callback in my app, so I just commented out the following line in vendor/plugins/attachment_fu/lib/technoweenie/attachment_fu.rb:

callback :after_attachment_saved

@tfl
Copy link

tfl commented May 30, 2010

you are right, dmann. Commenting this out "solves" the problem but raises a bigger one: an uploaded image will stay as it is - no further processing will happen. So... no thumbnail generation will take place. Disable callbacks makes attachment_fu almost useless.

It's a great pity because AF seems not be actively maintained anymore.

@jagthedrummer
Copy link

Take a look at :
http://github.com/woahdae/attachment_fu - rails3 branch

I installed it with :
./script/rails plugin install http://github.com/woahdae/attachment_fu.git -r rails3

So far (less than an hour in) it's working as I expect. I've even pulled in a few extensions that I've used for other projects and they're working too.

j1wilmot pushed a commit to Punchbowl/attachment_fu that referenced this issue Jul 11, 2017
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

4 participants