0
votes
0answers
18 views
Heroku rake db:migrate aborted with 'PG::Error:'
I'm trying to run my app on Heroku, and I can't get past the 'rake db:migrate' command.
I keep getting this error:
rake aborted!
An error has occurred, this and all later migrations canceled:
...
0
votes
0answers
32 views
+50
Handling PostgreSQL Creating Tables, Associations, and Rails
Long story short I decided to wipe out my database on my localhost and experiment with posgreSQL and pgAdmin with my Rails app. I first deleted any servers I had via pgAdmin. I then ran db:create:all, ...
0
votes
1answer
21 views
Validating numericality of postgres integer field in rails 3
my postgres database table was setup with
t.integer :time_employed
I had validations like so
validates :time_employed, numericality: true, allow_blank: true
and I also tried
...
0
votes
0answers
17 views
Postgres - could not connect to server after trying rake db:create:all
I'm trying to get Postgres up and running on OS X Lion - homebrew - rvm.
http://railscasts.com/episodes/342-migrating-to-postgresql
After following the above instructions, I ran into the same ...
0
votes
0answers
13 views
Custom ransacker returns error - undefined method `gsub' for []:ActiveRecord::Relation
I am using Ransack in my Rails 3.2.11 app and love it. I'm currently searching Profiles that match a given high school like so:
<%= f.check_box :profile_high_school_cont, {}, ...
0
votes
0answers
20 views
Postgres cannot connect to server on Unix domain socket 5432
Using Postgres 9.2.2, I keep getting this error when I try to start up rails server or run psql
could not connect to server: No such file or directory
Is the server running locally and accepting
...
0
votes
1answer
20 views
With CanCan, how do i limit ability based on association / child attribute
I have a db setup where there are many users, which have roles of member or admin. Each user has many cars. Each car has many timeslips
So, how do i limit a user's ability to edit a Timeslip only if ...
0
votes
1answer
31 views
Postgresql trigram text search with pg_search results order
I implemented a trigram search using pg_search gem on rails. https://github.com/Casecommons/pg_search
The problem is that sometimes the order of returned results doesn't seems right according to the ...
2
votes
1answer
33 views
Where can I learn about more advanced ActiveRecord queries?
Are there any books or resources which cover more advanced ActiveRecord queries, beyond just the nice methods we get in Rails, such as Model.association?
I need to learn more about joins across ...
0
votes
0answers
32 views
PostgreSQL installation with existing Ruby on Rails app
I am on Mac OSX lion and am new to Ruby on Rails programming, so bear with me.
I'm trying to work on a teammates' Ruby on Rails app, but it requires that I have PostgreSQL installed. I installed it ...
1
vote
1answer
24 views
Heroku DB Cache
On Heroku DB plans on crane and up, the cache is not 0 bytes.
Does this mean that in these plans if the code has
User.find(10)
for example, then the result of the query would be saved? thus ...
0
votes
1answer
40 views
Rails .joins query over multiple associations
I have this query that works as expected:
@dog.listings.joins(:address_country).merge(Country.where(permalink: 'uk'))
This query gives me the Listings where the country matches 'uk' (Listing has_one ...
0
votes
1answer
30 views
SQL error on PostgreSQL database on Heroku - can't run update
I need to run an update query over a database I have set up on a rails site on heroku. Its a simple query however for some reason when I try to run the sql from the sql console i.e Heroku sql I get a ...
0
votes
1answer
22 views
Understanding Rails / PG Explain
I know it's kind of an awkward question.. but I don't understand what EXPLAIN explains..
My query is User.last, it took more than 0.5 second
This is probably the simplest of queries, but it seems ...
0
votes
1answer
42 views
Adding multiple countries to a record
I am creating an app where businesses can get listed, and I would also like to add a facility where they can specify which countries they export to. So when a user searches for listings of a business ...