Chris Oliver

Joined

292,890 Experience
93 Lessons Completed
295 Questions Solved

Activity

Posted in Comments With Polymorphic Associations Discussion

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...

Posted in Comments With Polymorphic Associations Discussion

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!!

Posted in Comments With Polymorphic Associations Discussion

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. :)

Posted in File Uploading with Carrierwave Discussion

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! :)

Posted in Open Source Vlog - Setting Up Rspec Discussion

Please do! Even if you just want to start with documentation, it will be a huge help! :)

Posted in User Authentication with Devise | GoRails - GoRails

I plan on doing an episode on it in the future so keep your eye out for that. :)

Posted in User Authentication with Devise | GoRails - GoRails

Absolutely! Just be aware that separate models means your users can't ever switch roles from employee to client or client to admin for example. This is definitely the simplest route, but you can also check out rolify if you want to use a single User model and allow users to have different privileges at will. https://github.com/RolifyCo...

Yeah they definitely changed the API. That's what I get for recording an episode on new software. Thanks for sharing that! :)

Posted in Deploy Ubuntu 14.04 Trusty Tahr Discussion

Thanks Eluwa! I really appreciate it! :)

Posted in Deploy Ubuntu 14.04 Trusty Tahr Discussion

Thanks for sharing Shebaz! Part of the reason I don't link to an automated process is because I want people to learn and understand how to setup their machine. It's good to be familiar with all the tools and their configurations. These automated scripts are perfect after you're familiar with the basics! :)