3
votes
0answers
42 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
51 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
71 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
8 views
pg_search searching with dictionary: “spanish” not working
This is my scope
pg_search_scope :simple_search, lambda {|args, query|
return {:against => args,
:query => query,
using: { tsearch: { dictionary: "spanish"}} }
}
this ...
0
votes
0answers
21 views
data load scripts in Ruby - Make ETL in ruby scripts more dynamic
I have written a bunch of data loading commandline ruby scripts. Most of the scripts extract data from one database table and load the data to another database. For the most part, there is a ...
0
votes
0answers
33 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
48 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
30 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
44 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
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
61 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
13 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
51 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 ...
0
votes
0answers
37 views
Posgresql won't add columns to existing tables in rails application
I'm using paranoid gem to be able to mark records as deleted without actually deleting them.
To mark records as deleted it uses an additional column deleted_at
I have a migration which adds such ...