Tagged Questions
0
votes
0answers
4 views
Unable to install pg gem (Rails 3 - Cygwin) - sh: : command not found
When I run
$ gem install pg
I get the following
Building native extensions. This could take a while...
ERROR: Error installing pg:
ERROR: Failed to build gem native extension.
...
1
vote
1answer
24 views
Rails: A database-independent datatype that's suitable for bitwise operations
I have a Rails app with a couple resources that I need to run queries on the involve bitwise operations. Right now, I'm using PostgreSQL, and I created a migration for my 'user' model that uses the ...
1
vote
0answers
17 views
Rails 3 Saving User Searches DataModel
I am working on a piece of my app where the client is wanting the ability for user searches to be saved (these searches are completed by the user completing a set of dropdowns and then entering in a ...
0
votes
1answer
29 views
How to populate join table for a HABTM relationship Rails 3, postgresql
So after searching long and hard for information that can help us, we've found it difficult to find an answer we can work with.
Our problem is that we have two tables joined through a HABTM ...
0
votes
3answers
42 views
Big Integers and Custom Validation
I'm somewhat new to Rails and I'm trying to learn about custom validations.
One common requirement in Brazil are CPF/CNPJ/RG fields. They are a type of identification number and follow a specific ...
0
votes
1answer
33 views
PG::Error: ERROR: operator does not exist: double precision = boolean
I have the following query executed in rails using find_by_sql
select LEAST(a,b) as min_value ,
CASE LEAST(a,b)
WHEN LEAST(a,b) < 1.0
then 1.0
ELSE 1-LEAST(a,b)
END
from model where type=abc
...
1
vote
1answer
31 views
Dynamic table columns based on user preferences
Scenario
Lets say a user is a salesman. The User model has many log_entries used as a daily log for sales data. The user also has preferences that allow them to select what fields are visible in ...
0
votes
2answers
61 views
PG::Error: ERROR: permission denied for relation schema_migrations
Not sure why I'm running into this error. I've setup postgresql properly, just ran a migration and then rake db:migrate and I'm getting the title error.
Here is my:
database.yml
development:
...
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 ...
1
vote
1answer
42 views
Postgres data type integer[] in ruby
ruby : ruby 2.0.0p195 (2013-05-14 revision 40734) [x86_64-darwin12.3.0]
@user = User.find(1)
User Load (0.8ms) SELECT "users".* FROM "users" WHERE "users"."id" = $1 LIMIT 1 [["id", 1]]
=> ...
2
votes
1answer
38 views
Can't Save IDs from other tables into current table in database upon creation of an object Rails, Postgresql
I'm having problems getting multiple ids to save properly into my database.
I have a listing that has two parameters: a listing id and a price.
I've tried changing the controller to accept the ...
-3
votes
1answer
46 views
How can I get 20 users and 5 articles from each user? [closed]
Users can have many Articles.
I want to get 20 of the most recent users and for each user, 5 articles.
I was reading on http://wiki.postgresql.org/wiki/Find_recent_activity but this seems overly ...
0
votes
2answers
32 views
Problems with belongs_to condition in model
I'm making personal money management app. There I have 2 models: Account and Transaction.
Transaction has belongs_to :account and Account has has_many :transactions.
When I had account_id column in ...
0
votes
1answer
50 views
Postgres stopped connection on 127.0.0.1
I know this subject has been discussed, but none of the answers have helped me. Sorry, for starting a new topic on it...and thank you to anyone who helps.
I have been developing on my local ...
2
votes
2answers
29 views
Is it normal/adviced to have “id holes” in my user table (rails 3.2/postgresql)
I am a total newbie, training myself building a basic Rails app on Heroku (using postgresql and as db client PGAdmin)
I have a basic user table with name, email, password...
I have noticed that when ...