|
Buckhead posted:This is pretty cool. Is there a page that lists a summary of new features in Rails 4.1.0? Don't do that in Rails, configure your external log aggregator to do that.
|
# ? Feb 16, 2014 20:38 |
|
|
# ? May 15, 2024 13:00 |
|
atastypie posted:Using null in a boolean to mean anything more than an absence of a value is a bad practice. Thanks, after some further digging it looks like that's the same approach my coworkers are using to handle situations like this (defining the set of possible values in a constant and using that for form helpers/validations). Seems like the way to go for now.
|
# ? Feb 17, 2014 03:28 |
|
Deploying with Capistrano has been a real headache lately. I'm tired of all of my Rails 2.3.x deploys taking seconds while my Rails 3.1+ apps take ages because it has to run bundle install (even though my Gemfile hasn't changed) or run rake:assets:precompile (even though my assets haven't changed). Is there something better out there than Capistrano? Alternately, are there tried and tested recipes for skipping these long processes if they're not necessary? All I can find is some gists on blog posts from a few years ago that don't really work.
|
# ? Feb 17, 2014 06:55 |
|
prom candy posted:Deploying with Capistrano has been a real headache lately. I'm tired of all of my Rails 2.3.x deploys taking seconds while my Rails 3.1+ apps take ages because it has to run bundle install (even though my Gemfile hasn't changed) or run rake:assets:precompile (even though my assets haven't changed). Is there something better out there than Capistrano? Alternately, are there tried and tested recipes for skipping these long processes if they're not necessary? All I can find is some gists on blog posts from a few years ago that don't really work. The answer to the assets question is https://github.com/ndbroadbent/turbo-sprockets-rails3
|
# ? Feb 17, 2014 07:10 |
|
prom candy posted:Deploying with Capistrano has been a real headache lately. I'm tired of all of my Rails 2.3.x deploys taking seconds while my Rails 3.1+ apps take ages because it has to run bundle install (even though my Gemfile hasn't changed) or run rake:assets:precompile (even though my assets haven't changed). Is there something better out there than Capistrano? Alternately, are there tried and tested recipes for skipping these long processes if they're not necessary? All I can find is some gists on blog posts from a few years ago that don't really work. I'm switching to dokku, but that won't speed you up too much. Deploys on dokku take ~1-2 mins but it doesn't cache the gems or assets. Without changing deploy process, for your rails 3 apps, look into the turbosprockets gem. It fixes a few of the issues with assets precompiling. Also, your capistrano should be setting your bundler directory into the shared directory so it uses the same install each time. This is supposed to be done automatically with the bundler gem, but I dunno how you have capistrano set up. But you really should consider migrating rails 2.3.x up as it's EOL. Rails 3 - Rails 4, in my experience, isn't a very hard upgrade either, and it will solve your issues with assets precompile.
|
# ? Feb 17, 2014 07:11 |
|
I have about 100 rails 2 apps, we are probably going to get on the paid LTS version. We use turbo sprockets and/or rails 4 for asset pipeline apps but the process of checking if assets need to be precompiled still takes considerably longer than just not running the task or (I'm guessing) checking via looking at the commit. Bundle install does put gems in the shared folder but running bundle install even when nothing actually needs to be installed still takes time. I think I'm just going to have to write some recipes that look at what was committed and selectively run those commands.
|
# ? Feb 17, 2014 07:34 |
|
prom candy posted:I have about 100 rails 2 apps, we are probably going to get on the paid LTS version. yeah, looks like in your cases, you're pretty much doomed. Maybe look at modifying the capistrano 3 bundler gem to check for gemfile change? Cap 3, btw, is nice once you get through the learning curve. Having switched to pure rake helped.
|
# ? Feb 17, 2014 07:42 |
|
prom candy posted:Deploying with Capistrano has been a real headache lately. I'm tired of all of my Rails 2.3.x deploys taking seconds while my Rails 3.1+ apps take ages because it has to run bundle install (even though my Gemfile hasn't changed) or run rake:assets:precompile (even though my assets haven't changed). Is there something better out there than Capistrano? Alternately, are there tried and tested recipes for skipping these long processes if they're not necessary? All I can find is some gists on blog posts from a few years ago that don't really work. I've used this technique to pretty good effect over the last couple years. It's been a huge timesaver: http://www.bencurtis.com/2011/12/skipping-asset-compilation-with-capistrano/
|
# ? Feb 17, 2014 16:49 |
|
manero posted:I've used this technique to pretty good effect over the last couple years. It's been a huge timesaver: That was one that I was looking at. Does it work with Rails 4 and Cap 3? Edit: This does not work with Cap 3. I don't know what they've remapped the 'source' object to. prom candy fucked around with this message at 18:27 on Feb 17, 2014 |
# ? Feb 17, 2014 17:12 |
|
Is there an easy way to cast one column into another with a "friendly" name? Example: code:
Right now I have ID and Name, but need a way to interpret name to friendly name.
|
# ? Feb 19, 2014 23:02 |
|
The postgres unaccent extension does this. http://www.postgresql.org/docs/9.3/static/unaccent.html You can also create an expression index on that, if you find yourself doing searches on it.
|
# ? Feb 19, 2014 23:11 |
|
What are some of the best resources out there right now to learn Rails? I was using TeamTreehouse and had a working app pretty quickly but I realized that I wasn't really learning.
|
# ? Feb 20, 2014 13:10 |
|
Tomahawk posted:What are some of the best resources out there right now to learn Rails? I was using TeamTreehouse and had a working app pretty quickly but I realized that I wasn't really learning. http://ruby.railstutorial.org/ is pretty solid.
|
# ? Feb 20, 2014 17:34 |
|
kayakyakr posted:yeah, looks like in your cases, you're pretty much doomed. Maybe look at modifying the capistrano 3 bundler gem to check for gemfile change? I've had pretty good success using "bundle check || bundle install" instead of just "bundle install"
|
# ? Feb 20, 2014 20:25 |
|
An interesting side effect of cap 3 switching to normal rake tasks is that normal rake tasks are additive rather than overridden when you define them multiple times. So if you want to redefine something like deploy:assets:precompile you have to run clear_actions on it first. The other fun part about that is that when you clear a rake task like that it seems to clear any before or after tasks you attached to it. I'll post some working recipes when I figure them out.
|
# ? Feb 20, 2014 23:24 |
|
prom candy posted:An interesting side effect of cap 3 switching to normal rake tasks is that normal rake tasks are additive rather than overridden when you define them multiple times. So if you want to redefine something like deploy:assets:precompile you have to run clear_actions on it first. The other fun part about that is that when you clear a rake task like that it seems to clear any before or after tasks you attached to it. yeesh, that seems like it could be problematic.
|
# ? Feb 20, 2014 23:34 |
|
Does anyone use omniauth-facebook in conjunction with gravatar? I want to use a facebook photo if they connect through facebook, or if they do not, use their Gravatar, but I'm having difficulty finding a way to do this easily.
|
# ? Feb 21, 2014 17:40 |
|
I've been applying for ruby on rails jobs a lot lately, and the big thing that seems to be holding me back is that I don't have any experience dealing with applications "at scale." I'm running a "mission critical" rails app at my job, but it's mostly an internal app and it doesn't see a ton of traffic. The "do you have experience scaling rails apps" question keeps coming up on interviews, and I don't have a good answer for it. Our app is deployed on aws and I have experience with that side of things, but I haven't dealt with load balancing and I coulnd't sync databases between CDNs. How can I go about building some skill/knowledge in these areas without actually running a high traffic web application? Or should I not worry too much about this stuff if I'm just seeking a job as a junior developer?
|
# ? Feb 21, 2014 21:33 |
|
Okay, so two out of two interviews so far have touched on whether I was familiar with Rails. I am not, and I haven't done anything with Ruby past the tryruby tutorial months back, so I'm going to go ahead and just learn it already. Is the Rails tutorial a good place to start, or should I start with something more about Ruby in general?
|
# ? Feb 21, 2014 22:05 |
|
Pollyanna posted:Okay, so two out of two interviews so far have touched on whether I was familiar with Rails. I am not, and I haven't done anything with Ruby past the tryruby tutorial months back, so I'm going to go ahead and just learn it already. Is the Rails tutorial a good place to start, or should I start with something more about Ruby in general? Yeah it's the place to start. You don't need to start with Ruby. I'd start with Rails and then jump more deeply into Ruby later. But he even includes a more in depth look at ruby in section 3 or 4 or something. Alternatively you could just run through the codeacademy thing on ruby, that will get you up to speed in a few hours. Also don't listen to those guys who told you not to bother with the testing stuff -- they might not care about it but almost everyone else will.
|
# ? Feb 21, 2014 22:08 |
|
Pollyanna posted:Okay, so two out of two interviews so far have touched on whether I was familiar with Rails. I am not, and I haven't done anything with Ruby past the tryruby tutorial months back, so I'm going to go ahead and just learn it already. Is the Rails tutorial a good place to start, or should I start with something more about Ruby in general? That's what I would recommend to anyone that wanted to get into rails.
|
# ? Feb 21, 2014 22:11 |
|
USSMICHELLEBACHMAN posted:How can I go about building some skill/knowledge in these areas without actually running a high traffic web application? Or should I not worry too much about this stuff if I'm just seeking a job as a junior developer? Don't worry about it too much. There are way too many aspects of that question to learn without actually also having a high traffic app. There also really isn't a set of generally applicable answers, practices, or solutions. The proper thing to do changes every time you grow an order of magnitude. Just show that you'd be willing to learn.
|
# ? Feb 21, 2014 22:19 |
|
USSMICHELLEBACHMAN posted:Also don't listen to those guys who told you not to bother with the testing stuff -- they might not care about it but almost everyone else will. This is actually good advice. develop a good testing habit so that you don't develop a bad no-testing habit like I did. It's hard to break. USSMICHELLEBACHMAN posted:How can I go about building some skill/knowledge in these areas without actually running a high traffic web application? Or should I not worry too much about this stuff if I'm just seeking a job as a junior developer? You could caveat with not having had the fortune to have a high traffic web app yet, and then throw out a bunch of the usual suspects as things you would look into in order to scale upward: - Code refactoring - Smart Caching - Vertical Scaling using a multi-threaded or multi-process servers on more powerful hardware - Horizontal Scaling behind a load balancer - Database scaling if that is the bottleneck And on and on. Code refactoring is the most important part of that. You may be surprised at how much of an improvement you can get from identifying slow points and simply writing better, more efficient code. But really, I don't know why they would be looking for experience with app scaling in a jr dev position unless they were trying to fix a problem they have without actually spending the money to hire someone who knows how to fix it by stealing away a jr dev who has seen it done. I wouldn't worry about it too much.
|
# ? Feb 21, 2014 23:24 |
|
So do I want the videos+book package or just one of the two?
|
# ? Feb 21, 2014 23:39 |
|
Pollyanna posted:So do I want the videos+book package or just one of the two? I believe the online version of the book is free. If you like the option of reading it on an ereader or watching videos go wild and buy them I guess.
|
# ? Feb 21, 2014 23:42 |
|
Cool. l'll stick with the book. I'm confused on gems and gemsets and such. There's a section towards the beginning of the Rails tutorial that asks me to create a gemfile, but it's for RVM. I'm using rbenv and I installed bundler, how does that work in that case?
|
# ? Feb 22, 2014 00:23 |
|
rbenv doesn't have 'gemsets' and allows bundler to do its job. http://robots.thoughtbot.com/using-rbenv-to-manage-rubies-and-gems That is a decent writeup about using rbenv.
|
# ? Feb 22, 2014 00:26 |
|
kayakyakr posted:This is actually good advice. develop a good testing habit so that you don't develop a bad no-testing habit like I did. It's hard to break. Thanks, I'll at least learn how to talk about this stuff. I guess I'm frustrated because I've gotten the 'I guess we were looking for someone a bit more senior' line a few times now and really the only Rails thing I'm definitely inexperienced with is operating at scale. (But it could just be that I've said dumb things during interviews. Or that I'm applying at places that don't know what they want). I've asked a bit in the jobs thread, but I'll ask here: Aside from applying to everything on linked in, any leads for tracking down junior level rails positions? I've got about 2 years under my belt but like I said, it wasn't at any kind of scale. I feel like I should be a shoe-in for a jr position but I havent had a lot of luck yet.
|
# ? Feb 22, 2014 02:05 |
USSMICHELLEBACHMAN posted:Thanks, I'll at least learn how to talk about this stuff. I guess I'm frustrated because I've gotten the 'I guess we were looking for someone a bit more senior' line a few times now and really the only Rails thing I'm definitely inexperienced with is operating at scale. (But it could just be that I've said dumb things during interviews. Or that I'm applying at places that don't know what they want). Keep using SO Careers if you are already. Possibly WeWorkRemotely if you're interested in that, though they may generally be pickier. If you're looking to work in consultancies, the first quarter of the year is often rather slow from what I can gather. Companies will probably need to fill seats starting in April/May. Pollyanna posted:Cool. l'll stick with the book. A good choice on Rbenv but the Gemfile is basically just for managing libraries. A `gem install bundler` followed by `bundle install` will install all of the gems you have listed in the Gemfile. If you need any help, you can PM me.
|
|
# ? Feb 22, 2014 02:38 |
|
USSMICHELLEBACHMAN posted:Thanks, I'll at least learn how to talk about this stuff. I guess I'm frustrated because I've gotten the 'I guess we were looking for someone a bit more senior' line a few times now and really the only Rails thing I'm definitely inexperienced with is operating at scale. (But it could just be that I've said dumb things during interviews. Or that I'm applying at places that don't know what they want). I was in a very similar situation as you until I got my current job a couple of months ago. I started to think it was a trend that Rails jobs are looking for "10+ years experience ninjas (really 10?!)". I ended up finding a place that isn't as "Standard Rails Shop" which was good because they were flexible with my experience and I got a more mid level position with 2 years experience, but also not so great because they aren't really as good about things like TDD or Agile which makes it hard for me to keep those skills up since its all on my own. Also I got my current job through a recruiter, so if you are desperate for a middle of road job to just get some skills up and make some money that might be an option. Figured I would share my experience, but keep after it there are definitely places out there. MrDoDo fucked around with this message at 03:05 on Feb 22, 2014 |
# ? Feb 22, 2014 03:01 |
|
USSMICHELLEBACHMAN posted:Thanks, I'll at least learn how to talk about this stuff. I guess I'm frustrated because I've gotten the 'I guess we were looking for someone a bit more senior' line a few times now and really the only Rails thing I'm definitely inexperienced with is operating at scale. (But it could just be that I've said dumb things during interviews. Or that I'm applying at places that don't know what they want). Where are you located? That makes a lot of difference. You may try asking after a rejection where it was that they felt you weren't senior enough or what you did that turned them off. That might give you some sort of idea of what happened. 2 years is more than enough rails experience to fit into just about any job in the rails world. Keep up the confidence and keep at it. e: I'd hire you to write tests for me, if one of my projects turns into a full company... Let this be a lesson kiddos: develop a good testing habit or else you never will.
|
# ? Feb 22, 2014 09:24 |
|
Testing is especially important in a dynamic language like Ruby. With statically typed languages you can trust the compiler to a certain extent that your fancy refactored code doesn't blow up, but with Ruby, the only way to be sure is to run it.
Smol fucked around with this message at 14:20 on Feb 22, 2014 |
# ? Feb 22, 2014 13:45 |
|
Coming from someone who had testing beat into his head early on but fell off the wagon for a stretch once I was working solo, let me tell you it's important to keep up with. Even when you're starting out writing fairly simple interactions, write the loving tests even to just get comfortable writing them and not get rusty. REPL only gets you so far. Your future self who starts getting into more complex applications where you NEED them will thank you.
|
# ? Feb 22, 2014 18:58 |
|
Indeed. Any nontrivial rails application that doesn't have a high test coverage across the board is nearly impossible to modify safely. Don't learn this the hard way, like many of us have.
|
# ? Feb 22, 2014 20:42 |
|
Agree with all of the above. I think I'm going to start on a new side project today and try to test everything along the way. make new habits. I've liked rspec, but have never been comfortable with testing controllers... to mock or not to mock, that is the question.
|
# ? Feb 22, 2014 21:14 |
|
kayakyakr posted:Agree with all of the above. I think I'm going to start on a new side project today and try to test everything along the way. make new habits. Testing controllers has always been the least fun part for me. I usually just do enough to be satisfied it's not horribly broken. If you need much more than that, your controller is probably too fat anyways.
|
# ? Feb 22, 2014 21:27 |
|
USSMICHELLEBACHMAN posted:Thanks, I'll at least learn how to talk about this stuff. I guess I'm frustrated because I've gotten the 'I guess we were looking for someone a bit more senior' line a few times now and really the only Rails thing I'm definitely inexperienced with is operating at scale. (But it could just be that I've said dumb things during interviews. Or that I'm applying at places that don't know what they want). How to fake knowing how to scale:
|
# ? Feb 23, 2014 20:42 |
|
I'm experimenting with Hobo right now and basically just learning at this point. Am I right that I should be setting up all of my resources first and then going in and defining the relationships between them? I'm working on a small social network with Users, Pages, Events, Posts etc.
|
# ? Feb 24, 2014 09:35 |
|
Hey guys. In Rails 4.0, is there a way to have multiple attributes of a single polymorphic type on a single model? For example: Ruby code:
In the example above, making a call to SomeObject.first.descriptions.first would return the same record as SomeObject.first.instructions.first. All I'm looking to capture in the WikiEntry object is the who, when, and what with user, updated_at, and content attributes, respectively. The above example is intentionally simplistic, but I think it illustrates what I'm trying to do. I know I'm missing a Type field somewhere, but I'm not sure where it should go. I tried creating a subclass of the WikiEntry class and associating that with SomeObject, but ultimately I ran into the same problem. I know I'm missing a layer and I can't pinpoint it. Anybody have any advice? Fillerbunny fucked around with this message at 19:24 on Feb 24, 2014 |
# ? Feb 24, 2014 16:26 |
|
|
# ? May 15, 2024 13:00 |
|
Normy posted:I'm experimenting with Hobo right now and basically just learning at this point. Am I right that I should be setting up all of my resources first and then going in and defining the relationships between them? Yes, you generate the resources, then you add your relationships (so your models\user.rb would get "has_many :posts" and "children :posts", models\post.rb would get "belongs_to :user"), then do a "hobo generate migration". Hobo does a lot of weird magic and I like it for things that you have to get together super fast, but I've found it kind of frustrating to use for more detailed projects. EAT THE EGGS RICOLA fucked around with this message at 16:45 on Feb 24, 2014 |
# ? Feb 24, 2014 16:34 |