3
votes
0answers
48 views

numeric field overflow - which field exactly?

In case of an error: PG::Error: ERROR: numeric field overflow DETAIL: A field with precision 2, scale 2 must round to an absolute value less than 1 How do I configure postgres or ...
3
votes
0answers
35 views

Cancel Rails DB connection

I am writing an app that uses Server Side events with ActionController::Live. It is using the puma app server. A method in the Messages controller stays alive while the user is connected waiting for ...
1
vote
0answers
47 views

Heroku + Rails 3.2 + PostgreSQL = NoMethodError: undefined method `result' for #<NoMethodError:..>

NoMethodError: undefined method `result' for #< NoMethodError: ...> Stack trace refers to this place: def current_income return @current_income if defined? @current_income if ...
1
vote
0answers
64 views

Calling PL/pgSQL Stored Procedures from Ruby on Rails

I am working on a project where I am the database designer/admin in a PostgreSQL environment. The leader has decided to use Rails for the application logic and recruited a Rails programmer. The Rails ...
0
votes
0answers
22 views

Cucumber and RSpec testing with zeus: Postgres is being accessed by other users

In my Rails 3.2.13 app, I'm using Zeus. In the test environment I use PostgreSQL. When I run Cucumber and then RSpec (or the other way around), 9 out of 10 times I get the message: PG::Error: ERROR: ...
0
votes
0answers
47 views

Rails: How to select a limited amount of rows for each foreign key?

Here's how it's done using pure SQL but is it possible to do this in Rails w/ Postgres? How to select a limited amount of rows for each foreign key?
0
votes
0answers
25 views

Count active users over time (ROR)

I have the following model and attributes: class Student < ActiveRecord::Base attr_accessible :name, :active, :date_of_withdrawal, timestamps #:active = boolean Im trying to count the ...
0
votes
0answers
37 views

Setting connection parameters postgresql in ruby

When I run my rails server, and load up my localhost:3000 page, I get an error saying that I haven't supplied the database password. I'm using the better errors gem, so it shows me to go to my ...
0
votes
0answers
15 views

Is it possible to write a Rails SQL call to find the ordered sum of children of children?

Brain < has_many > QuestionGroup < has_many > Questions < belongs_to > Weakness Is there an elegant way to order Question Groups by which has the most Weaknesses ?
0
votes
0answers
21 views

Will a product-price history table greatly affect db performance?

I have over a million products in a db. Each product's price fluctuates often. I plan on storing these price fluctuations in a "price history" table (product_id, price, validity_start_date, ...
0
votes
0answers
54 views

ActiveRecord::RecordNotFound: Couldn't find Debtor with id=

I recently converted a project from MongoDB/mongoid to PostgreSQL. After the transition, all of my model specs are passing and I have most controller specs passing. Three of my controllers are not ...
0
votes
0answers
11 views

Datamapper model with UUID causes rake db commands stop with Model must have a key to be valid

I have a rails project defined using datamapper 1.2 models. I'm using postgresql and I'd like to use UUID as the property type in place of serial. However, when I do this, all of my rake db commands ...
0
votes
0answers
25 views

What explicit type casts should I add to make a no operator method work

I'm trying to use the near method of the Ruby geocoder gem in a Rails application with a postgres database. @users = Contact.near(params[:search], params[:distance]) That line produces the ...
0
votes
0answers
42 views

New Rails app Postgres won't install

I just started a Rails 4 app from scratch with the intention to use Postgres. I went and changed the database.yml file to the following: development: adapter: postgresql encoding: unicode ...
0
votes
0answers
45 views

Using Sqlite3 test database and Postgres dev/production database in Rails

I currently have a rails project which I deploy to a production server which uses a postgres database. I develop my rails project in Windows, which means that if I want to test locally, I have to ...

1 2 3 4 5 6
15 30 50 per page