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

Identifier nil when using multi file upload #1581

Closed
philipgiuliani opened this issue Mar 3, 2015 · 1 comment
Closed

Identifier nil when using multi file upload #1581

philipgiuliani opened this issue Mar 3, 2015 · 1 comment
Labels

Comments

@philipgiuliani
Copy link

I implemented the multi-file upload functionality in my new project, and when i call now image.identifier it returns nil.

Example in console:

shoe = Shoe.first
shoe.images[0].url
# => "/uploads/shoe/images/1/2_4.jpg" 
shoe.images[0].path
# => "/full-path/public/uploads/shoe/images/1/2_4.jpg"
shoe.images[0].identifier
# => nil

In the meantime i am using

shoe.images_identifiers[0]

Branch: master
Ruby: 2.2.0
Rails. 4.2.0

@avgerin0s
Copy link
Member

Yeap, this happens if you are using the same attribute as a mounter and a serialization column.

In order to get the identifier, you can use the image_identifiers method that you already to or

shoe.images[0].file.identifier

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants