RailsCasts Pro episodes are now free!
Learn more or hide this
GitHub User: jamesw
You mention that this is not suitable for tasks that run frequently but give no indication as to why it is not suitable or even what might be suitable.
I have a need to poll for changes to the database every 2 minutes, if changes are found then add add to sidekiq worker jobs for processing.
I have a rake task that looks for the changes and handles adding to the worker queue. I would be interested to know what might be a suitable solution for running a rake task every couple of minutes in this type of frequently polling scenario
How do you reference a boolean field?
If the value of a boolean field is false then the field will not be included in the json response
It's about time you got some financial reward for all your hard work.
I have an issue about this episode though. Surely the logic that is being placed in the decorator belongs in the model?
I see things like if there is no uploaded avatar then provide a default avatar as business logic and default values provided by the model can be used for xml, json responses, rake tasks etc...
I feel this approach goes against the grain and I feel that this sort of approach is a solution to a deeper problem which is that not enough developers know where to put their logic.
In other words I can't help thinking that this seems to be fixing symptoms of bad coding rather than providing a solution to the cause. We have models, why not use them?
Please ignore the above! I had some file corruption causing this
For anyone reading this thread controller inheritance in Rails 3.0.3 has totally stuffed OO development principles for controllers.
I've raised a ticket here https://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/6783-rails-303-controller-inheritance-is-broken.
I'm checking out 3.1 to see if this is still an issue and I'll post back here if it is.
Well, that makes sense but if you do that you should make a more obvious/additional link to this area. The title link isn't that obvious. Maybe place a second button to the right of the watch button to get to the show notes, comments etc... ?
On second thoughts, make the button to this area the first button and the watch button the second button. I think new visitors might take a long time to find this area if it were the other way round.
Hi Ryan, thought it about time I posted a comment.
Thank you for the hard work on Railscasts over the years they have been an invaluable source of information for me.
I'm liking the new site and it's nice to see that the new github login authorisation integration is going to stop all that horrible spam. Only one minor aesthetic suggestion to make and that is the link from the Railscast index page to the specific railscast implies that you are going to watch the video. On first visit that threw me a little.
I also want to say a huge thank you for the change logs for 3.1 - A massive help and exactly what the Rails community needs. I'm going to add a link to those to my signature on the Rails Forum.
At last I see that there is view inheritance in Rails 3.1, something I've been desperate to have for a couple of years now and Rails seems to be finally turning into a much friendlier and consistent environment to work with.. Big hats off to the Rails development teams :)
Thanks for a superb job on this cast, the new site and the change logs.