|
Alternatively, I can offer you an unpaid internship writing tests for our cludge of a startup app
|
# ? Feb 17, 2015 00:48 |
|
|
# ? May 24, 2024 14:53 |
|
Seems reasonable ! That's what I've been doing so far, just gradually making progress on a pet project. (And ty for the offer of a second, unpaid job)
|
# ? Feb 17, 2015 00:58 |
|
I felt bad calling my startup a cludge. It's actually pretty decent code on the back end. It's the front end that can get cludgy. An ember monolith, as it is. But we really do need to get the testing suite sorted out. We've got sporadic integration tests, unit tests, tests that do nothing, tests that are testing features that aren't in the system anymore. It's a big mess. My first attempt to get one of the partners to write tests for some functionality (as a way to help him learn ruby and rails) wound up with a 2000 line monstrosity >_<. So #1) What's a fair value for a "bounty" on a test to bring in an outside entry/junior developer, and #2) anyone have any suggestions for integrating JS testing for the Ember stuff into a Rails test suite?
|
# ? Feb 17, 2015 01:27 |
|
If you're looking to sharpen your skills you could consider trying to close some issues for open source gems. It doesn't matter which one. It's a little like jumping into the deep end of a pool without knowing how to swim, but it will encourage you to do good things like write tests, analyze someone else's code, document changes, and create good pull requests. It isn't building a Rails app, but I would argue that you will learn more and have a bigger impact than if you just worked on a pet project. Even if your PRs get rejected
|
# ? Feb 17, 2015 01:52 |
|
atastypie posted:If you're looking to sharpen your skills you could consider trying to close some issues for open source gems. It doesn't matter which one. It's a little like jumping into the deep end of a pool without knowing how to swim, but it will encourage you to do good things like write tests, analyze someone else's code, document changes, and create good pull requests. It isn't building a Rails app, but I would argue that you will learn more and have a bigger impact than if you just worked on a pet project. Even if your PRs get rejected That sounds interesting! I'll look into them as they come up. Is there a good place to see these aggregated? Or is it more case-by-case?
|
# ? Feb 17, 2015 05:59 |
|
semicolonsrock posted:That sounds interesting! I'll look into them as they come up. Is there a good place to see these aggregated? Or is it more case-by-case? Well, github would be the obvious choice, but someone it's actually impossible to find things on github.
|
# ? Feb 17, 2015 06:47 |
|
Could always look at a site like http://www.ruby-toolbox.com to see what the most popular ones are, then dive into one on Github to see what its open issues are.
|
# ? Feb 17, 2015 09:41 |
|
kayakyakr posted:What's a fair value for a "bounty" on a test to bring in an outside entry/junior developer? As an entry/junior developer who just went through the job search wringer, don't do this. One of the companies I interviewed with wanted me to basically work there for 3 days on one of their problems as part of the interview process, which felt like too much of a time investment to me, especially when I had interviews going at the same time. It didn't reflect well on the company, in my opinion. Not saying you'll be doing exactly that, but it tends to turn us off. As for integrating Ember with Rails and Rails testing, my advice is don't. The best way to combine Rails with front-end frameworks, in my opinion, is to keep them decoupled from each other by making the Rails app an API that the front-end app consumes. Basically, make them two separate projects. This has the side effect of not causing merge conflicts if two people working on different "ends" touch the same file - I constantly ran into this issue while working on some projects, and this helped immensely. Pollyanna fucked around with this message at 18:48 on Feb 19, 2015 |
# ? Feb 19, 2015 18:35 |
|
I'm pretty sure asking people to produce work for you for free as part of the interview process is illegal.
|
# ? Feb 19, 2015 19:43 |
|
What does bounty on a test mean?
|
# ? Feb 19, 2015 19:50 |
|
KoRMaK posted:What does bounty on a test mean? Instead of an hourly fee or a project fee, I would want to pay a completion fee for each test file. Basically, I could estimate how long it would take me to write the test, apply a rate, and set that as the bounty so it would be worth, say, $100 for each completed spec. Pollyanna posted:As an entry/junior developer who just went through the job search wringer, don't do this. One of the companies I interviewed with wanted me to basically work there for 3 days on one of their problems as part of the interview process, which felt like too much of a time investment to me, especially when I had interviews going at the same time. It didn't reflect well on the company, in my opinion. Not saying you'll be doing exactly that, but it tends to turn us off. Not part of the interview process, just a way to set contracting rates. That is a pretty BS thing. If they're going to ask you to work there for 3 days, they had better be paying you for it. In general, when hiring for a mid+ level position, I will either want to see a github with various projects or will ask for a 2-3 hour example project (generally just setting up the project, doing some data modeling and scaffolding) or a 2-3 hour modification to a project I set up. For jr/entry level, I really just want to see that you can intelligently talk about programming, problem solving, and general technology. Pollyanna posted:As for integrating Ember with Rails and Rails testing, my advice is don't. The best way to combine Rails with front-end frameworks, in my opinion, is to keep them decoupled from each other by making the Rails app an API that the front-end app consumes. Basically, make them two separate projects. This has the side effect of not causing merge conflicts if two people working on different "ends" touch the same file - I constantly ran into this issue while working on some projects, and this helped immensely. The two are decoupled. They live in the same project, but the rails side operates as API while the Ember side operates on its own. I do still want integration/regression tests on the whole thing, though, as that's where most of our issues are occurring. Merge conflicts are a part of programming. You'll get used to them. I was thinking about using this project for the JS testing: https://github.com/jfirebaugh/konacha.
|
# ? Feb 19, 2015 20:13 |
|
I've got the feeling I'm not writing my tests properly:Ruby code:
Ruby code:
|
# ? Feb 23, 2015 20:26 |
|
MasterSlowPoke posted:I've got the feeling I'm not writing my tests properly: http://betterspecs.org/ is a great resource, and I try to stick to it whenever it makes sense. I'm looking at your tests and the relationship between lead and activities makes it a bit weird. I would probably do: Ruby code:
Ruby code:
EVGA Longoria fucked around with this message at 21:01 on Feb 23, 2015 |
# ? Feb 23, 2015 20:47 |
|
Gotcha, thanks. I've written these tests for my user model using that info, do they look good?Ruby code:
As an aside, I don't like this pattern on my admin scope: Ruby code:
Ruby code:
|
# ? Feb 24, 2015 18:06 |
|
I keep running into the same problem with many-to-many relationships in Rails, and I've never really found a great solution. It deals with storing meaningful data in join tables, and I'm hoping there's something obvious I'm missing, not that it's just a limitation of rails. Here's a stripped down version of the current iteration: code:
Edit: If I could force the link between a and b to use the link object I've created, I think that would solve this. Is there a way to do something like code:
Peristalsis fucked around with this message at 19:46 on Feb 26, 2015 |
# ? Feb 26, 2015 19:40 |
|
Peristalsis posted:I keep running into the same problem with many-to-many relationships in Rails, and I've never really found a great solution. It deals with storing meaningful data in join tables, and I'm hoping there's something obvious I'm missing, not that it's just a limitation of rails. Have you tried futzing with #build? That should set up associations without persisting. http://api.rubyonrails.org/classes/ActiveRecord/Associations/ClassMethods.html
|
# ? Feb 26, 2015 20:20 |
|
Whenever I want strong guarantees about complex associations, I usually create a "manager" poro to deal with creating, persisting, and validating associated objects.
|
# ? Feb 26, 2015 20:46 |
|
The Milkman posted:Have you tried futzing with #build? That should set up associations without persisting. I have not - I'll look into that, thanks. I sort of got things working well enough for now just by explicitly constructing and populating the link objects, but anyone using that code is going to have to be aware that the top level voodoo (i.e. the a.class_bs as b.class_as links) just won't work until after saving the objects. If these build methods can set this up better in the future, that'd be sweet. MALE SHOEGAZE posted:Whenever I want strong guarantees about complex associations, I usually create a "manager" poro to deal with creating, persisting, and validating associated objects. That's an interesting idea, but I'm not sure how it would work. Do you just have something that replicates the rails functionality that you feel is too complicated or unreliable? It's not something I want to retrofit into a bunch of code right now just to fix a medium-sized bug, but I'd like to hear more about it.
|
# ? Feb 27, 2015 15:16 |
|
Peristalsis posted:
Mainly I use it to escape from callback hell (esp after delete callbacks, shudder), but it also works nicely for creating and validating associations. code:
http://samuelmullen.com/2013/05/the-problem-with-rails-callbacks/ DONT THREAD ON ME fucked around with this message at 22:18 on Feb 27, 2015 |
# ? Feb 27, 2015 22:04 |
|
Should probably examine_poop(poop) before flush_toilet
|
# ? Feb 27, 2015 22:46 |
|
It doesn't say the poop goes in the toilet. The flush is probably just so no one else knows what you're up to in the stall.
|
# ? Feb 27, 2015 22:58 |
|
This is why we have unit testing.
|
# ? Feb 27, 2015 23:30 |
|
Quick question, as I didn't get enough sleep last night Is there a way to do this purely in AR/SQL? code:
In my haze I initially wrote this code:
|
# ? Mar 5, 2015 20:58 |
|
i guess it's not purely AR but couldnt you do .where("countries.alpha2 NOT IN (?)", @country_exclude_list)
|
# ? Mar 6, 2015 01:09 |
|
xenilk posted:i guess it's not purely AR but couldnt you do That should generate equivalent SQL to .where.not(countries: { alpha2: @country_exclude_list }). Example: 2.1.3 :003 > puts Accounts::Account.joins(:solus_servers).where.not(solus_servers: { id: [1, 2] }).to_sql SELECT "accounts_accounts".* FROM "accounts_accounts" INNER JOIN "solus_servers" ON "solus_servers"."account_id" = "accounts_accounts"."id" WHERE ("solus_servers"."id" NOT IN (1, 2))
|
# ? Mar 6, 2015 01:49 |
|
I wrote a script that tries to operate on a large subsection of the database, but it's super slow and non-performant and I was looking for a way to speed it up. Without getting into too much detail, I'm trying to get a list of "users" who have at least one of X associated model, and do NOT have any of Y associated model. I got up to something like this:Ruby code:
|
# ? Mar 7, 2015 02:29 |
|
Maybe go about it backwards? Something like Ruby code:
Two simple queries instead of a join query. On phone so may be typos.
|
# ? Mar 7, 2015 03:00 |
|
Pollyanna posted:I wrote a script that tries to operate on a large subsection of the database, but it's super slow and non-performant and I was looking for a way to speed it up. Without getting into too much detail, I'm trying to get a list of "users" who have at least one of X associated model, and do NOT have any of Y associated model. I got up to something like this: With SQL, this is accomplished with a left outer join: SQL code:
|
# ? Mar 7, 2015 03:44 |
|
Does anyone have a hard time using refinements in a meaningful way? I'm trying to fix some code. Ages ago, some knucklehead did this:code:
The actual implementation of RestClient looks like: code:
I want to do something like: code:
code:
But at that point, I'm back where I started: everything is being overridden globally. I mean, there are other ways to deal with this, but none of them are particularly nice.
|
# ? Mar 7, 2015 05:22 |
|
EVGA Longoria posted:With SQL, this is accomplished with a left outer join: They're not that bad. Don't want to pull up a AR console to test this, but you should be able to write inline joins similar to: Ruby code:
|
# ? Mar 7, 2015 07:48 |
|
#eager_join instead of #includes uses left joins where possible.
|
# ? Mar 8, 2015 14:10 |
|
I've been a Python developer for a long while, and I'm inheriting and taking on a lot of Ruby projects at work right now. We use Puppet extensively as well as other internal tools written in Ruby. Seems like there is a lot of overlap conceptually between Python and Ruby. Python meet ups have stupid names about snakes and Holy Grail this and that, while all the Ruby meet ups seem to happen on Tuesdays. Can you guys recommend a book (I need to have pages) to help pick up Ruby? Otherwise I was just going to default to Oreilly.
|
# ? Mar 8, 2015 20:45 |
|
I liked rails tutorial -- an ebook. Has links to other works as well. Related question: I'm on my second Ruby project, and I realized this basically is just a a static site except for the contact form. Is there a good general approach to making heavily html/Css/JavaScript sites back ends in Ruby if you really don't need it to do much? Of course I could just do it like normal, but wondering if there is a shortcut.
|
# ? Mar 8, 2015 21:15 |
|
duck hunt posted:I've been a Python developer for a long while, and I'm inheriting and taking on a lot of Ruby projects at work right now. We use Puppet extensively as well as other internal tools written in Ruby. Seems like there is a lot of overlap conceptually between Python and Ruby. Python meet ups have stupid names about snakes and Holy Grail this and that, while all the Ruby meet ups seem to happen on Tuesdays. Especially for someone coming from Python, I recommend Metaprogramming Ruby 2. It may sound kind of specific, but I'm assuming you don't need to know how if statements work or whatever. The metaprogramming bits are most of what distinguishes Ruby from Python anyway.
|
# ? Mar 8, 2015 21:35 |
|
duck hunt posted:I've been a Python developer for a long while, and I'm inheriting and taking on a lot of Ruby projects at work right now. We use Puppet extensively as well as other internal tools written in Ruby. Seems like there is a lot of overlap conceptually between Python and Ruby. Python meet ups have stupid names about snakes and Holy Grail this and that, while all the Ruby meet ups seem to happen on Tuesdays. Practical Object-Oriented Design in Ruby: An Agile Primer Has a lot of praise....i also liked eloquent ruby
|
# ? Mar 8, 2015 22:02 |
|
xenilk posted:Practical Object-Oriented Design in Ruby: An Agile Primer Can I assume that by Eloquent Ruby, it is like the Eloquent Javascript book?
|
# ? Mar 8, 2015 22:24 |
|
semicolonsrock posted:Is there a good general approach to making heavily html/Css/JavaScript sites back ends in Ruby if you really don't need it to do much? Methinks you're looking for Middleman.
|
# ? Mar 9, 2015 00:16 |
|
My code has two versions, a base branch and then a customized branch. Currently, the customized one is just a superset of the base. I merge my master branch into the customized one periodically. I'm trying to think of the right implemenation so that the customization code doesn't exist in any file in the base. Right now, if I make changes to customization branch I make them in the relevant file. This results in periodic conflicts and other weirdness that I want to eliminate. A first iteration improvement to this could be to create a second file that corresponds to each existing file requiring additions, and put the customization code in there. That's kind of lame though, so maybe I should make it as a gem or something. I think I need to look into packaging an app as a gem, and including it without using ruby gems.
|
# ? Mar 9, 2015 03:14 |
|
aunt jemima posted:Methinks you're looking for Middleman. This is exactly what I was hoping for, thank you!
|
# ? Mar 9, 2015 05:09 |
|
|
# ? May 24, 2024 14:53 |
|
duck hunt posted:I've been a Python developer for a long while, and I'm inheriting and taking on a lot of Ruby projects at work right now. We use Puppet extensively as well as other internal tools written in Ruby. Seems like there is a lot of overlap conceptually between Python and Ruby. Python meet ups have stupid names about snakes and Holy Grail this and that, while all the Ruby meet ups seem to happen on Tuesdays. The Ruby language itself is really easy. I'd recommend The Well-Grounded Rubyist for picking it up. The Ruby community tends to embrace a lot of OO patterns and focus on a lot of "code smells". Check out https://github.com/bbatsov/ruby-style-guide for guidance on the stylistic things. It's almost universally adhered to in my experience, so it's good to know and it makes a lot of Ruby code feel very familiar even if you've never seen it before.
|
# ? Mar 9, 2015 13:36 |