Activity
Ah yeah! I've had to remove bin from that as well. Not sure what changed but that definitely fixes the problem.
Posted in how scrabe data every day
You guys are awesome. :)
Mechanize is good. I've used that before. I've never checked out Scrapy or Wombat, but I'm sure they are awesome too.
Using whenever to schedule this script every morning will make that part easy.
I'll see about adding this to the list of screencasts to cover!
If you're using Devise, as long as you do the email/password registration as the first step, that makes it pretty easy. You can use like https://github.com/schneems/wicked to setup the rest of the steps.
I would just put a before_action
around all your controllers so that it forces your user to an "awaiting approval" page until they are approved. You can still let them log in and view their account but they won't be able to do anything.
Sounds like you installed the vagrant rubygem before. You'll want to uninstall that and download it from vagrant's website instead.
You shouldn't have any trouble. Rails handles it well. But you're right that with polymorphism you don't get the same database level enforcement like you would with the individual associations.
I haven't personally run this in production yet, but you might check out this screencast. https://www.driftingruby.co...
If you don't go with polymorphism and you want comments on multiple models, you will need to have two different tables for comments, like PostComments and UserComments, but why do that when you could combine them into just Comments? Really that's the main difference. You reduce duplication there.
Hey Stefan,
So my advice with storing this stuff in the model is only to do it if you'll need it for queries. I think that'll be important (filtering by businesses that are open) so it makes sense to be there. Do you have a data format for saving the hours the places are open? Will they always be a consistently open chunk of time like 9-5? I imagine days and weekends will have different hours too. Do you need to handle that as well?
I hope you can get a Jr Rails position soon! I should do a screencast on talking about how I got my first jobs as a developer.
HJKL in vim for movement scared me off but I actually just used the arrow keys for most of the first few months. That saves you a lot of trouble (and so does the Janus set of plugins).
I'm glad you've been enjoying everything!!
The main difference is that you probably have tied your comments to the Post model. With polymorphism, you could have comments on the Post model, the User model, or any other model you've got.
And thank you a bunch for subscribing!!
Learning Vim proved to be super useful for me over the years! :)
Posted in The State_Machine Gem Discussion
I think you are right! I have just not used the gem that often since the last time and this wasn't available then. It does seem to be a community supported version that is the most up to date. Thanks for sharing!
I've had to do this before. I think you have to pass in an option into the autolink plugin (or copy it and write your own that uses target blank. Can't remember off the top of my head but I did ask about it in an issue on the Github repository.
Posted in What Is A State Machine? Discussion
Hahaha! If I had been brought up a few hours north I'd be calling it "pop" instead. :)
Posted in The State_Machine Gem Discussion
A crazy in-depth example is this for video games: http://jessewarden.com/2012...
They are a fantastic use case for state machines because you've got to keep track of so many things when it comes to power ups. Take just the ghosts in pacman for example: http://oddwiring.com/archiv...
I would say that if you want to try this out, try building a soda machine where you type in the various coins you put into the machine and it counts up and dispenses the soda (and change) once you've hit the correct price. You can just write these events out as strings into the console and that would be a good first experience with it.
Posted in Setup MacOS 10.10 Yosemite Discussion
Haha! You're welcome. :)
Hey @renzomxdiaz:disqus,
It looks like maybe the filename is getting set as the picture attribute and not the file itself. In any case, are you trying to use my example code of how Carrierwave works behind the scenes or with Carrierwave itself?
Posted in The State_Machine Gem Discussion
You're welcome! :)
Please do! Even if you just want to start with documentation, it will be a huge help! :)
I plan on doing an episode on it in the future so keep your eye out for that. :)