Skip to main content

All Questions

Filter by
Sorted by
Tagged with
1 vote
2 answers
87 views

Querying and rendering an HTML table of ISP performance statistics

I have multiples measurements and I want to render it into tables like this Measurements Operator browsings FTP DL FTP UL Location Event Date Operator avg min max avg min max avg min max Verizon ...
buncis's user avatar
  • 107
3 votes
0 answers
130 views

Assigning raffle numbers to users in Rails

Background One part of our Rails app is running a Raffle, usually twice a month, with around 600k entrants each round. Each raffle ticket record will have at least a unique raffle number (consisting ...
user63764's user avatar
2 votes
1 answer
240 views

Listing employees, categorized by license expiration date

I am working on a personal project and I have hit a wall. I know I am writing bad code and I really want to refactor the code below. The application has three tables on the same page. Each table ...
Benjamin's user avatar
3 votes
1 answer
223 views

Imported data from CSV successfully, but slow

Currently I am using the gem activerecord-import to seed more than 55,000 records into my database, and it works fine. However, it takes too much time. I am ...
Fatima's user avatar
  • 143
3 votes
1 answer
378 views

Getting timeslots using a single query

I want to get latest time slots for 2 cases based on doorman true for false based on logged in user. Cases are: If doorman is true, the query will be the same if doorman is false, then I need to add ...
LearningROR's user avatar
2 votes
1 answer
122 views

Checking whether a store is open or not by querying over its business hours

I currently have a method that checks if the store is open. It's working nicely, however on the main page I have quite a few stores. Whom again have different locations. Each of these locations again ...
Sebastian Jennings Almnes's user avatar
3 votes
1 answer
153 views

Ruby on rails instance loops

I am trying to use a custom sql query to display different attributes for a product i.e. Size and Price. The query I have when running in console displays as it should ...
Boss Nass's user avatar
  • 131
2 votes
0 answers
87 views

Fetching photos and tweets related to selected publications

1) Postgresql 2) User has_many :reports 3) Report belongs_to :user 3) Report belongs_to :publication 4) Publication has_many :reports 4) Publication scope :photos, -> ...
Legendary's user avatar
2 votes
1 answer
129 views

Building query for search engine

I'm writing a basic search engine for my website. It works but I'm really unhappy with the code. I know it can't be improved but I'm lacking some experiences here. In my params from my search I get: ...
bl0b's user avatar
  • 405
7 votes
1 answer
13k views

Faster way to update/create of a large amount of records?

In our Rails 3.2.13 app (Ruby 2.0.0 + Postgres on Heroku), we are often retreiving a large amount of Order data from an API, and then we need to update or create each order in our database, as well as ...
Bjorn Forsberg's user avatar
2 votes
1 answer
287 views

Importing markdown files

I'm building a rails app that, among other things, imports text markdown files as blog posts. The idea is that the truth is in the markdown files, so any time those are edited, created, or deleted, ...
Matt Martin's user avatar