Tagged Questions
0
votes
0answers
43 views
Rails - PostgreSQL group by and order by another
I have a score model where users can play and add scores. When I pick the highscore I don't want to let users have more than one score on the scoreboard.
Therefore I need to sort the score by points ...
0
votes
0answers
48 views
$ rails db fails with error, but database is working fine
My Rails 3.2 app is using a PostgreSQL database. It's working great locally. I can migrate and interact with the application through the browser or irb.
However when I run $ rails db, I get an error: ...
0
votes
0answers
16 views
trigram search returning <PgSearch::ScopeOptions::DisableEagerLoading:0x3fce0aef3130>
In my NewContact model, I have the following:
pg_search_scope :contact_from_search, :against => [:first_name, :last_name, :email],
:using => {
...
0
votes
2answers
34 views
Creating a scope to compare 2 dates
I have a model called Feed that records two timestamps, Last_visited and Last_modified.
I'd like to render a list of feeds where last_modified > last_visited
I currently have this scope in my model:
...
2
votes
1answer
181 views
Heroku Rails could not fork new process for connection: Cannot allocate memory
I have 3 Rails applications that all use the same code base. 2/3 of the applications are running fine, but one of them gives me this error:
could not fork new process for connection: Cannot allocate ...
0
votes
0answers
45 views
Rails + PostgreSQL: How Do I save TimeStamp Values?
I'm building an API on Rails w/ Postgres, and users will be sending GET, POST & PUT requests of timestamps. I will not be handling timezones. It's up to the users to submit in UTC. So, what ...
0
votes
0answers
19 views
activerecord uncached method not working for postgresql
I have a rails app that uses postgresql and I want to temporarily disable query caching for the purpose of testing my query times.
The following solution works for sqlite database, but i have been ...
0
votes
0answers
78 views
rails g scaffold! uninitialized constant in development environment
I got my ror development environment setup on ubuntu 10.04, using postgresql database. I was doing a test to generate a scaffold when I got:
<module:AppName>: uninitialized constant ...
1
vote
0answers
33 views
Rails item feed of distinct items shared by users followed by the current user
So I'm trying to make a feed of items in which the items are distinct, and each item can be shared by many users. My data model is:
User: has_many :postings, has_many :products, :through => ...
0
votes
1answer
29 views
Connection refused (PGError) (postgresql and rails)
I keep getting this error when i try to run my localhost using "$rails s":
(Mac OSX 10.8.3)
(ruby 2.0.0p195 (2013-05-14 revision 40734) [x86_64-darwin12.3.0])
(Rails 3.2.11)
(psql (PostgreSQL) ...
0
votes
0answers
32 views
Rails apartment switch schema per session
I have an application, where every user has to have his own schema in postgres database.
Now I use apartment gem, but it allows just to switch schema globally per whole application, not per every ...
0
votes
0answers
50 views
radio button counter in database
Ruby on Rails beginner here.
extremely simple question.I have a form with 4 radio buttons. a,b,c,d.
everytime a user selects one of the four options and hits submit,i want the value incremented by 1 ...
0
votes
1answer
109 views
Using Postgresql with Amazon Opsworks - Getting IP address in database.yml
I'm trying to get a basic rails app working with Postgres using Amazon Opsworks. Opsworks lacks built-in support for Postgres at the moment, but I'm using some cookbooks that I've found which seem to ...
1
vote
0answers
52 views
Why does Rails change the time returned from a Postgres function to UTC?
Can anyone explain this? It is as if Rails is overriding Postgres and telling it to work in UTC when I want it to work in my local timezonw?
I have a Postgres function which returns the local time as ...
0
votes
0answers
76 views
Ruby on Rails: Postgres Relation 'lists' does not exist
I'm getting a weird error. I had sqlite3 working and now switching over to postgres, i'm getting this error.
I have migrations, and I had to add a new column.
create_ideas migration
class ...