|
Don't be, seeing action in the Rails thread makes me feel relevant again!
|
# ? Dec 7, 2016 21:50 |
|
|
# ? Jun 3, 2024 22:55 |
|
lol Ruby 2.4 https://twitter.com/hubertlepicki/status/806469337611640833
|
# ? Dec 8, 2016 00:56 |
|
I just installed ruby 2.3.3 like two days ago!
|
# ? Dec 8, 2016 01:09 |
|
serious question, who thought this would be a good idea?? I can agree that change is good, but changes like that is seriously loving scary, no? Edit: Ok so reading more into it it's supposed to align with a certain standard... so the reasoning behind it has some legimacy... but holy crap this is still scary. xenilk fucked around with this message at 01:56 on Dec 8, 2016 |
# ? Dec 8, 2016 01:53 |
|
That's nothing compared to the date parsing changes in 1.9
|
# ? Dec 8, 2016 02:05 |
|
xenilk posted:serious question, who thought this would be a good idea?? I can agree that change is good, but changes like that is seriously loving scary, no? look at it on the bright side: when your boss asks you why revenues have declined significantly, you can tell them it was literally a rounding error!
|
# ? Dec 8, 2016 02:08 |
|
enraged_camel posted:look at it on the bright side: when your boss asks you why revenues have declined significantly, you can tell them it was literally a rounding error! hahah I guess it's the perfect case as to why money should be treated in cents or at least with decimals, right? :P
|
# ? Dec 8, 2016 02:10 |
|
So i sat with the guy who is like the department liasion between dev and implementation today. He's got some coding experience as he's responsible for all the scripts we currently run and he walked me through putting all this together. This actually works, which is whats the most important to me, but i'd be curious to see what ya'll though about how we went about it... I ripped his login process from an importation script we run, so i didn't write that all. He helped me define the different steps irt def get_signatures and all that he also helped me define classes and explain what that was You guys really helped me by i giving me the vocabulary to explain what i want to do and a framework with how to do it in relation to hashes and arrys because when i started talking to him, he was like....I don't use hashes I don't really know how to interact with them....and than you guys really helped me think of my concept in like a ruby programming way and how it would work Please review my lovely coding that took me literally 8 hours to do code:
I still need to specify client signatures but that is a task for tomorrow Waroduce fucked around with this message at 05:53 on Dec 8, 2016 |
# ? Dec 8, 2016 05:51 |
|
That code is pretty good actually. You're on the right track using a plain Ruby object and organizing it in logical, short functions. To be constructive, try to picture how you would adapt this code such that the class takes fewer arguments and no method is over five lines. Even experienced Ruby developers have trouble with this, but following Sandi Metz' rules will force you to write good OO code. You'll be compelled to make more, smaller plain Ruby objects. xtal fucked around with this message at 13:19 on Dec 8, 2016 |
# ? Dec 8, 2016 13:05 |
|
Honestly, that's a head above what I see juniors produce out of school. Not bad at all for a first project.
|
# ? Dec 8, 2016 14:42 |
|
enraged_camel posted:look at it on the bright side: when your boss asks you why revenues have declined significantly, you can tell them it was literally a rounding error! Don't use floats for money
|
# ? Dec 8, 2016 18:01 |
|
I have a quick question regarding adding a colom for client signatures.... my complete code is above but if i wanted to add the ability to check on/off client sigs I would do this: code:
I think i'm missing an end command somewhere....and does the order of my elseif statements matter in relation to the formdata << title << clientsigs so on and so forth? E: I'm gunna have a really weird competency level after I finish this Waroduce fucked around with this message at 18:40 on Dec 8, 2016 |
# ? Dec 8, 2016 18:34 |
|
necrotic posted:Don't use floats for money Yup. Integers in cents is the right way to do it. Really not looking forward to migrating away from that mistake :-/
|
# ? Dec 8, 2016 19:14 |
|
Also how would I make it read Y,y, or Yes,yes/ N,n,no,Noinstead of just y? I can restrict input on the excel spreadsheet to accept only the value I've built the code w but it's not very elegant
|
# ? Dec 8, 2016 20:47 |
|
necrotic posted:Don't use floats for money I don't. I just wanted to crack a joke!
|
# ? Dec 8, 2016 21:27 |
|
Ruby on Rails Love-In: Office Space now a reality
|
# ? Dec 8, 2016 21:37 |
|
kayakyakr posted:Yup. Integers in cents is the right way to do it. We do 10-5 for those sweet fractional cents. Fortunately we had always done integer cents, but we started at 10-2 hard coded and moving to 10-5 was quite a trick. We essentially store an exponent field for all monetary values now, which allowed us to start translating to the higher precision safely. necrotic fucked around with this message at 18:06 on Dec 9, 2016 |
# ? Dec 9, 2016 18:03 |
|
Waroduce posted:Also how would I make it read Y,y, or Yes,yes/ N,n,no,Noinstead of just y? code:
Array#include? returns true if the provided argument exists in the array. %w() is shorthand for initializing an array of simple string values. necrotic fucked around with this message at 18:10 on Dec 9, 2016 |
# ? Dec 9, 2016 18:08 |
|
So the VP really likes my script and wants to build it out and make it a standard part of our implementation process. He doesn't know dick about coding, but he wants to add features like having it rip form names out of the baseline and generate a csv/excel file, embed hyperlinks of the forms into the name and some other poo poo. He wants me to write a scope of work for our implementation process which is a whole can of worms and do one for my script. Like where does it fit and what should it accomplish. So this may be a bit beyond the scope of the thread but you guys have helped me so far, what are some resources or tips for writing a scope of work for this script/software thing before the vp dumps this on development and tells them to make it happen.
|
# ? Dec 12, 2016 21:35 |
|
Whew, looks like Matz said no to this and it's rolled back https://bugs.ruby-lang.org/issues/12958#note-18
|
# ? Dec 12, 2016 21:43 |
|
Pardot posted:Whew, looks like Matz said no to this and it's rolled back https://bugs.ruby-lang.org/issues/12958#note-18 Nice to see sanity win one.
|
# ? Dec 12, 2016 23:39 |
|
Waroduce posted:So the VP really likes my script and wants to build it out and make it a standard part of our implementation process. He doesn't know dick about coding, but he wants to add features like having it rip form names out of the baseline and generate a csv/excel file, embed hyperlinks of the forms into the name and some other poo poo. I like user stories as a way to define the scope of a software project.
|
# ? Dec 13, 2016 04:02 |
|
Time to necro this thread. I'm trying to use Capybara to test a file upload page. It's a simple page with a file upload field constructed with a file_field_tag helper, a text box, and a submit button. I've tried having Capybara click on the "Select File" button, but I can't access (or even see) the file selector dialog that comes up, so I can't select a file. I've tried using page.attach_file(<file control name>, <File path>) and then clicking on the submit button, but the controller doesn't receive any file param for me to work with. I'm not sure what else to try here. Is attach_file just a way to directly set the value of the form parameter before submitting? If not, is there a way to do that?
|
# ? Jan 20, 2017 21:34 |
|
Does it work outside of Capybara, manually? The form itself may be missing the correct incantation to enable uploads. http://guides.rubyonrails.org/form_helpers.html#uploading-files note the multipart option on the form tag.
|
# ? Jan 20, 2017 22:04 |
|
necrotic posted:Does it work outside of Capybara, manually? The form itself may be missing the correct incantation to enable uploads. I'll be damned. It was working before (at least to the point of being able to set a debugger in the controller and examine the file object), but when I just double-checked it, that's failing now, too. Sounds like a good problem to pick up Monday morning. (Or, more likely, tomorrow, since I'm way behind on this project.) Thanks for the sanity check.
|
# ? Jan 20, 2017 23:10 |
|
necrotic posted:Does it work outside of Capybara, manually? The form itself may be missing the correct incantation to enable uploads. Peristalsis posted:I'll be damned. It was working before (at least to the point of being able to set a debugger in the controller and examine the file object), but when I just double-checked it, that's failing now, too. Sounds like a good problem to pick up Monday morning. (Or, more likely, tomorrow, since I'm way behind on this project.) Okay, now it works manually, but the test fails in the same way: It uses page.attach_file to attach the file to the form, then clicks the submit button. When it gets to the controller, params['test_file'] doesn't exist.
|
# ? Jan 21, 2017 23:35 |
|
Does anyone have a good setup for tallying events/data somehow? Like using for A/B testing tracking metrics server-side? We've been using Datadog/statsd, but it messes with the numbers in weird ways.
|
# ? Mar 20, 2017 14:47 |
|
EVGA Longoria posted:Does anyone have a good setup for tallying events/data somehow? Like using for A/B testing tracking metrics server-side? statsd can do weird things if you have your retention settings wrong, but it really is the gold standard. I was just reading these articles this weekend: https://kevinmccarthy.org/2013/07/18/10-things-i-learned-deploying-graphite/ https://matt.aimonetti.net/posts/2013/06/26/practical-guide-to-graphite-monitoring/ Otherwise, a simple counter in Redis could get you what you want, just make sure you have it's persistence configured correctly so you don't lose data.
|
# ? Mar 20, 2017 15:44 |
|
Thanks, reading those makes me wonder if it's something wrong with datadog's dashboard. Specifically, I have metrics that I'm sending as a count (whole numbers), and displaying as the sum of that count for the last hour, and it's coming out with decimals like it's a rate. Any ideas?
|
# ? Mar 21, 2017 03:25 |
|
EVGA Longoria posted:Thanks, reading those makes me wonder if it's something wrong with datadog's dashboard. I don't have any experience with DataDog, but perhaps it's trying to average things out across a time bucket? I just found this in the FAQ: http://docs.datadoghq.com/faq/#why-is-my-counter-metric-showing-decimal-values http://docs.datadoghq.com/guides/metrics/#counters
|
# ? Mar 21, 2017 18:47 |
|
Is it possible to create duplicate RAILS_ENVs, just with different names? We run a couple of staging environments that use the Production rails env, which is rough for monitoring/tracking. I'd like to split it out, so that we can have a production and a staging config -- but without having to maintain the same config in 2 files (they will inevitably drift).
|
# ? Apr 17, 2017 15:45 |
|
EVGA Longoria posted:Is it possible to create duplicate RAILS_ENVs, just with different names? We run a couple of staging environments that use the Production rails env, which is rough for monitoring/tracking. I'd like to split it out, so that we can have a production and a staging config -- but without having to maintain the same config in 2 files (they will inevitably drift). I kind of feel you can't have it both ways. Either you create a separate RAILS_ENV and have duplication between staging and production, or just run production everywhere. What sort of things are you running into with monitoring? If you're following 12 Factor (https://12factor.net/config) -- you probably should be -- push all the actual environment-specific stuff into ENV. I do this with separate staging and production "environments" for a client's app on Heroku, but they are both running as RAILS_ENV=production. I'm using Honeybadger for app monitoring, and they support a HONEYBADGER_ENV setting, so you can be running RAILS_ENV=production on multiple apps, but then set HONEYBADGER_ENV=staging, and it shows up as a separate environment of the same app in the Honeybadger UI.
|
# ? Apr 17, 2017 16:52 |
|
manero posted:I kind of feel you can't have it both ways. Either you create a separate RAILS_ENV and have duplication between staging and production, or just run production everywhere. Yeah, I got tired of duplicating staging and production configs and now do it all through ENV. It's especially good on Heroku, because I can pre-configure for a bunch of our commonly used addons by checking for certain ENV vars and have adding/removing them Just Work
|
# ? Apr 17, 2017 17:17 |
|
manero posted:I kind of feel you can't have it both ways. Either you create a separate RAILS_ENV and have duplication between staging and production, or just run production everywhere. It's monitoring things like the honeybadger you mention, but we've got a lot of places. I was hoping I could have it both ways, but if not, I guess we'll start using another variable.
|
# ? Apr 17, 2017 22:43 |
|
ENV everything you can. But in a pinch you could probably make a shared env file that you load in the specific environment files with any env specific settings only set in that specific envs file. But using ENV is way better.
|
# ? Apr 18, 2017 01:06 |
|
necrotic posted:ENV everything you can. But in a pinch you could probably make a shared env file that you load in the specific environment files with any env specific settings only set in that specific envs file. Most things already use ENV, it's more about not having to adjust a lot of existing code to read the name of the env instead of from Rails.env
|
# ? Apr 24, 2017 13:41 |
|
You push the env value into the rails config, don't reference it directly in app code.
|
# ? Apr 24, 2017 18:16 |
cross posting my noob question from the SQL thread:quote:Huge noob Postgres question inbound:
|
|
# ? May 14, 2017 02:28 |
|
I'd open a support ticket with heroku.
|
# ? May 14, 2017 02:50 |
|
|
# ? Jun 3, 2024 22:55 |
|
Is there any solution to the n+1 problem in rails for update/creates? I have an object that has a relationship to many other objects and I need to update all those other objects. Ideally, I'd like the sql generated to be one giant insert statement, rather than many little ones.
|
# ? Jun 1, 2017 17:05 |