Comments (8)
hmm. I bet there's a way to do this simply. I haven't explored much into changing the primary key of a table. Is there a rails model method that gives the primary key column name?
from delayed_paperclip.
Actually i was looking around and i think that replacing
self.class.where(:id => self.id).update_all(updates)
with
self.class.where(self.primary_key => self.id).update_all(updates)
will allow the correct primary_key to be loaded. As far as i can see this works in my development app.
from delayed_paperclip.
That sounds perfect. Mind submitting a pull request?
On Sunday, August 18, 2013, Cristian Rivera wrote:
Actually i was looking around and i think that replacing
self.class.where(:id => self.id).update_all(updates)
with
self.class.where(self.primary_key => self.id).update_all(updates)
will allow the correct primary_key to be loaded. As far as i can see this
works in my development app.—
Reply to this email directly or view it on GitHubhttps://github.com//issues/51#issuecomment-22824553
.
Sent from Mobile
from delayed_paperclip.
Yea I will definitely make a pull request but after more testing I realized
that using self.primary_key isn't reliable. I'm trying to add an option
that the user can pass an option stating the primary key.
Sent from my iPhone
On Aug 18, 2013, at 4:20 PM, Scott Carleton [email protected]
wrote:
That sounds perfect. Mind submitting a pull request?
On Sunday, August 18, 2013, Cristian Rivera wrote:
Actually i was looking around and i think that replacing
self.class.where(:id => self.id).update_all(updates)
with
self.class.where(self.primary_key => self.id).update_all(updates)
will allow the correct primary_key to be loaded. As far as i can see this
works in my development app.—
Reply to this email directly or view it on GitHub<
https://github.com/jrgifford/delayed_paperclip/issues/51#issuecomment-22824553>.
Sent from Mobile
—
Reply to this email directly or view it on
GitHubhttps://github.com//issues/51#issuecomment-22838324
.
from delayed_paperclip.
What's not reliable about it?
On Sunday, August 18, 2013, Cristian Rivera wrote:
Yea I will definitely make a pull request but after more testing I
realized
that using self.primary_key isn't reliable. I'm trying to add an option
that the user can pass an option stating the primary key.Sent from my iPhone
On Aug 18, 2013, at 4:20 PM, Scott Carleton <[email protected]<javascript:_e({}, 'cvml', '[email protected]');>>
wrote:
That sounds perfect. Mind submitting a pull request?
On Sunday, August 18, 2013, Cristian Rivera wrote:
Actually i was looking around and i think that replacing
self.class.where(:id => self.id).update_all(updates)
with
self.class.where(self.primary_key => self.id).update_all(updates)
will allow the correct primary_key to be loaded. As far as i can see
this
works in my development app.—
Reply to this email directly or view it on GitHub<https://github.com/jrgifford/delayed_paperclip/issues/51#issuecomment-22824553>
.
Sent from Mobile
—
Reply to this email directly or view it on
GitHub<
https://github.com/jrgifford/delayed_paperclip/issues/51#issuecomment-22838324>.
—
Reply to this email directly or view it on GitHubhttps://github.com//issues/51#issuecomment-22839220
.
Sent from Mobile
from delayed_paperclip.
It's only available within the actual model to set the primary key and not
outside of it.
from delayed_paperclip.
I'm sure we could make that work. On calling process_in_background, that's called within the actual model so you could add the primary key there to the delayed defintions. I believe that we could even avoid adding it to the options set because #mark_enqueue_delayed_processing should also be defined with in the model it's updating.
from delayed_paperclip.
After a few more tests inserting self.primary_key isn't working, i think that i thought it worked because i had some other code inserted that i was testing as an alternative. I think that we might have to add this as an option. Also looking though the ActiveRecord API self.primary_key can only be used to set the primary_key.
from delayed_paperclip.
Related Issues (20)
- Latest commit to paperclip master breaks gem HOT 1
- undefined method `[]=' for nil:NilClass HOT 2
- Delayed Job w/ s3, Missing required :bucket option error HOT 11
- FFMPEG hangs/stalls when converting large files HOT 1
- Errors are silently swallowed instead of being raised to the background processor HOT 1
- Needs a failure callback
- Not saving original file - only those styles specified in only_process are created HOT 4
- paperclip-document style is not working with background
- Gem doesn't work with S3 HOT 4
- Handle Record Not Found Exceptions HOT 2
- NoMethodError: undefined method `fetch' for nil:NilClass with postgres HOT 1
- Release latest changes in master
- Support Priority of DelayedJob. HOT 2
- Processors not being called HOT 2
- Job failed to load: undefined class/module DelayedPaperclip
- Linking existing S3 object to Paperclip does not trigger Delayed::Job HOT 1
- Not generating cropped images when using papercrop
- Creates original style twice on S3
- How to skip process_in_background method call in some case
- Avoid creating jobs when nothing to process
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from delayed_paperclip.