Skip to main content
Gravatar
Optimizing Queries in Service Objects
Ruby Solved • Asked by Jacob Warren
I'm currently building an app and using namespaced service objects containing a single call method in each class. Below is an actual method (I'm aware the ABC size is too large, I'm wanting to g...

Gravatar
Regexp for prices or how to detect price in a smart way
Ruby • Asked by Jack
Any regexp experts here? I have the following situation: - get an invoice - scan it for prices and save the highest number - success 🍾 I do this with a `.scan(/…/)`. Pretty fast in Ruby. ✨ ...

Gravatar
Proper location for null objects
Ruby Solved • Asked by Alex Musayev
I've recently watched couple of screencasts on using Null Object Pattern: https://www.rubytapas.com/2017/01/31/two-screencasts-two-ways-eradicate-ruby-nil-values It was a good reminder about a ques...

Gravatar
How can I subscribe a user when creating a new project?
Ruby Solved • Asked by Lauro Silva
**How can I subscribe a user when creating a new project?** I'm having a hard time on the `create` method. Currently this is my code: ### Projects controller ```ruby def create ...

Gravatar
Error running Rails with Ruby 2.4.0
Ruby • Asked by Menj Villalobos
``` [Menj]~/RubymineProjects/myapp2$ rails s /Users/Menj/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/activesupport-5.0.1/lib/active_support/xml_mini.rb:51: warning: constant ::Fixnum is deprec...

Gravatar
Retrieve all Project Threads where a given users has posted a Project Post
Ruby Solved • Asked by Lauro Silva
A user belogns to a ProjectThread. And a ProjectThread has_many Users through ProjectPosts. On the Project Thread Index I want to display only threads where a given users has posted a Project P...

Gravatar
How do I iterate over an array of nested hashes in a view?
Ruby Solved • Asked by Premila Anand
I have an array that has nested hashes of months, years and amounts that I want to diplay in a table. My data is in this format: [{:month=>"January", :years=>{2017=>20, 2018=>100, 2019=>300}}, ...

Gravatar
Install Ruby from binaries on production: do or do not?
Ruby Solved • Asked by Alex Musayev
I'm using rbenv with ruby-build plugin as a default way to install ruby for development and production environments. Is there a way to make installation process faster, but keep it stable? For e...

Gravatar
Ruby version stuck on macOS
Ruby Solved • Asked by RJ McCollam
Setting up my new MacBook Pro and am running into an issue with ruby versions. At this point I have installed and am usin rbenv. I installed ruby 2.3.1 and when I `ruby -v` that is what it shows...

Gravatar
CSV Import
Ruby • Asked by Sascha M.
My question is about this Episode: https://gorails.com/episodes/upload-csv-form The CSV Import works fine (I'm using the exact same code actually). My 1. Question - How can I define an alias ...