0
votes
1answer
15 views

Rails - Heroku Postgresql SQL Error - Works on Local SQLite - Error “ActiveRecord:Invalid Relation”

Hi here is my ActiveRelation query that works fine on local development environment (SQLite) @table2_items = @table1var.table2_items.find(:all, conditions: ["status1 is ? AND status2 is ? AND ...
0
votes
4answers
63 views

SQL ORDER BY LIKE

This is similar to my previous question located here.Is there any way in SQL (using ActiveRecord) that you can order a relation using the LIKE operator? For instance, I'm querying a relation where one ...
0
votes
2answers
22 views

Getting all results from `includes` while filtering the parent model based on included elements?

I'm working on a small bug in our app which I'll attempt to simplify here. I have this company model (the actual model has many more associations, but this here displays the problem): class Company ...
0
votes
2answers
35 views

Rails can't see my Postgres database

I'm trying to load a Rails 3.2 project on my Macbook and I'm having difficulty. I installed Postgres 9.1.4 via brew. After putting /usr/local/bin in the front of my $PATH, I can now get into Postgres ...
0
votes
1answer
20 views

OS X rails3 postgresql cannot create database not recognizing its default username

On a machine running OS X 10.6 a rails 3.2 environment is attempting to create the databases, but failing. Rake gems tested: include 0.9.2.2 (installed by some dependency) and a declared 10.0.4. ...
0
votes
2answers
83 views

Complex Rails Query

I have a model structure as below: User has many Surveys through ResponseSets(user can attend same survey multiple times there by creating ResponseSets for each attempt). ResponseSet has many ...
0
votes
2answers
78 views

ROR + PgAdmin + psql: FATAL: role “user1234” does not exist

In my sample project, I am trying to create postgre database. While running the rake db:create, I am getting some strange message and unable to create the database. ...
2
votes
1answer
36 views

Rails test database getting wrong column type on geographic columns

We have a rails app that uses postgis and activerecord-postgis-adapter for geographic information search. However, it doesn't work right in the test database. In development and production database, ...
1
vote
1answer
48 views

Active Record: Find collection based on sum of two associated tables

I am trying to find the collection of 'underpaid' events in our system. We are running Rails 3.2 using a Postgres database. The data structure is as follows. class Event < ActiveRecord::Base ...
0
votes
1answer
47 views

adapter is postgresql, rails server Can&#39;t connect to MySQL server

Although database.yml is configured as follows, development: adapter: postgresql database: saim_development username: jerdvo launching Thin web server (v1.5.0 codename Knife), apparently runs ...
0
votes
1answer
84 views

merging multiple models in rails 3.2 so that users can log in under multiple subdomains using devise

I'm using devise for authentication and am stumped by the way that my users are associated with the subdomains they can log in under. I've studied the info plataformatec provides here and the great ...
-1
votes
1answer
60 views

Sort group of records based on different columns

I have a four columns in table called recordings such as score, event_id, user_id and I would like to sum the score of recordings based on user id + event id, and then I would like to show the users ...
2
votes
1answer
43 views

Select unique records ordered by date

I have 2 following models: class Schedule < ActiveRecord::Base attr_accessible :description, :deadline_on, :repeat has_many :scheduled_transactions end class ...
0
votes
1answer
31 views

rake db:setup is failing for production because I am referencing a Model for a table that yet to be created in an initialier

I'm trying to deploy my application on EngineYard. Right before assets:precompile it checks for database changes as part of the migration. This is causing a failure for me, because I am pre-loading ...
0
votes
1answer
42 views

Disk Size Of Schema PostgreSQL on Rails

I have multitenant app rails and tried for to get size disk of schema posgresql per account. Initially, I tried it at the views, roughly like this : <% for account in @accounts %> <td> ...

1 2 3 4 5
15 30 50 per page