0
votes
1answer
16 views

Data dump filetype for not-yet-existant SQL database

A friend wants to start scraping data for a data-heavy site he wants me to try to build. I'm a (relatively new) Rails developer and don't know much about the data side of all this. If he's contracting ...
0
votes
1answer
29 views

Adding unique two-column index with already not unique data

I have a rails app and need to add a unique constraint, so that a :record never has the same (:user, :hour) combination. I imagine the best way to do this is by adding a unique index: add_index ...
1
vote
1answer
29 views

Delete all except the last x number of rows in database

Is there a way, using rake, to delete all but the last 30 or so results from the database? Would I have to get the database count, check the result from 30 back and then delete all with a creation ...
0
votes
2answers
33 views

Rails select query to MSSQL returns -1:Fixnum

I have Rails connected to an external MSSQL database. In database.yml the adapter is sqlserver. The code for the query: class External < ActiveRecord::Base def self.select_all_entries ...
0
votes
3answers
36 views

how to automatically delete a record from the database in rails

i have a rails table setup called products and its all working well, lets assume i want to auto delete a record 3 weeks after creation how do go about the code my product db is as follows class ...
0
votes
1answer
16 views

Storing array in database to prevent database hit in Rails

I am using the acts_as_taggable gem, which has a method tag_list, which produces an array of tags, but requires an SQL call. I have been research optimization and am curious if it would be good ...
0
votes
1answer
12 views

ActiveRecord Association for Grades App

A bit hard to explain with a title. I am making a test grades app with Ruby on Rails, and can't figure out the best ActiveRecord Association setup. Ideally: there are many Users, and there are ...
1
vote
1answer
35 views

Is there a normal range of database calls in rails app?

I have a Ruby on Rails app and it displays a list of programs. Each of those programs has a like/unlike button, so there is a database query for each program on whether or not a User Likes the program ...
0
votes
2answers
34 views

Database schema for multiple choice Trivia game

I'm trying to determine the most efficient db schema for a multiple choice trivia game. I have the questions and answers in a spreadsheet with the columns, 'question_id', 'level', 'question', ...
-3
votes
2answers
27 views

synchronization database rails application [closed]

In the case of process automation synchronization database, I want to design and develop an application migration management databases of different engines. In a first time, I want to focus on three ...
0
votes
1answer
33 views

Proper way to add forgeign keys in db?

So - I've been learning rails for the last 4 months and would like to think that I have a pretty good overview of it. Albeit, there are a few gray areas that I would like to make clearer. One being ...
0
votes
1answer
22 views

One to Many Relationship: List of many not showing up

I have a simple one to many relationship mapping users to posts. Here is the relevant part of the schema: create_table "users", :force => true do |t| t.string "username" t.string ...
-2
votes
0answers
27 views

Database extern in ruby on rails [closed]

I want to know how I can generate a class from a database extern which is not in my rails Application. I want really your help. Thanks you
0
votes
2answers
46 views

A better database model for holding postage prices

I wanted to create a Postage_costs table to hold postages costs, each postage_cost has a name, e.g Large Item, which has different costs(standard price and express postage price) depending on ...
0
votes
1answer
26 views

Postgres Bulk Data Import and Populate Associated Data

I have a Postgres database that gets updated from various external sources several times a day, and each record has fields like company_id and user_id that need to get looked up from an existing table ...

1 2 3 4 5 107
15 30 50 per page