Tagged Questions
9
votes
1answer
596 views
Use Postgres Multiple Schema Database in Rails
I'm developing a multitenant app following this article. The problem is when I run all migrations the first time. In schema.rb file are only the tables for the public schema but what happend with the ...
3
votes
1answer
417 views
JSON data type in Rails4 form_for
how to achieve filling values from JSON PostgreSQL type into nested form in rails?
I have a model like
title :text
description :text
grid :json
Inside properties I want to store a dimension and ...
1
vote
1answer
451 views
Postgres operators for JSON data type using Rails 4
Got a record:
2.1.1 :202 > r.column_data
=> {"data1"=>[1, 2, 3], "data2"=>"data2-3", "array"=>[{"hello"=>1}, {"hi"=>2}], "nest"=>{"nest1"=>"yes"}}
Trying to query inside ...
1
vote
1answer
650 views
Bulk create records in rails?
Ok so I have a rails application called HashtagMapper.com which finds tweets by the thousands and maps them. The problem I am having is that between geocoding 1000+ queries can take up to 10 seconds, ...
1
vote
1answer
973 views
set up postgres users, roles and databases for rails
This really has me stuck, I'm a bit of a noob trying to use postgres for rails 4
I have postgres installed:
$ psql --version
psql (PostgreSQL) 9.1.10
contains support for command-line editing
$ ...
0
votes
1answer
17 views
comparison of [type] with [other_type] failed on Rails 4, postgresql with hstore
When doing an upgrade from Rails 3, postgresql with activerecord-postgres-hstore gem to Rails 4, postgresql and native Rails 4 hstore, I started getting masses of issues with tests failing (which ...
0
votes
1answer
51 views
How to set default 'uuid-ossp' extension to all migration files using rails?
How to set default 'uuid-ossp' extension to all migration files?
enable_extension 'uuid-ossp'
I'm using ruby 2.1 and rails 4
PostgreSQL
Thanks,
0
votes
1answer
67 views
Efficient database querying Rails
I'm using Rails 4 with PostgreSQL, and I have a table Quotes gets populated at random times. Sometimes two entries are milliseconds apart, sometimes hours (end of trading day). I'd like to build a ...
0
votes
1answer
214 views
Thinking Sphinx without records within date range error
im trying to find records that are NOT created in a certain date range using a thinking sphinx query in my rails 4 project with postgresql as database
THIS WORKS
Housing.search "some text",
star: ...
0
votes
1answer
226 views
Rails PG::Error Presentation and Handling of Unique Constraint
I am developing on Rails 4 with postgres and devise. I have the following User model:
# user model
class User < ActiveRecord::Base
extend FriendlyId
friendly_id :username, :use => :slugged
...
2
votes
0answers
133 views
Disable automatic cast of cidr columns in rails 4
When using rails4 and having columns in a postgresql database of type cidr, rails now casts them to type IPAddr. In rails 3 they we simple strings.
How can I disable this casting so that I get the ...
1
vote
0answers
59 views
PostGIS performance issue with grabbing points by bounding box
I'm working on a google maps application along with Postgresql and PostGIS that fetches markers based on the current viewport of the map and the zoom level (each marker has a min and max zoom level ...
1
vote
0answers
78 views
Populating rails Database from Amazon RDS data
I currently am working on an inventory application(rails 4.0 on Heroku using PostgreSQL). I also have a database that tracks my sales on Amazon RDS using Sql Server 2008. I'd like to figure out a way ...
1
vote
0answers
145 views
Flickering Tests with PhantomJS and Rspec
I am using PhantomJS in my Rails app for integration testing of a form that is submitted through AJAX. My test suite runs green the first few times, and then eventually I run into these errors, which ...
1
vote
0answers
200 views
How can I order by a specific condition in Active Record?
To list all the shops in my database, I have the query
@shops = Shop.includes(:opening_times)
.references(:opening_times)
.limit(paging)
.offset(@offset)
If I ...
1
vote
0answers
34 views
Batch text search with PostgreSQL
I have a Rails 4 app with PostgreSQL database. I use PSQL default full text search for some fields, such as university_name. I need to send hundreds of full text search query at a time against my ...
1
vote
0answers
440 views
Rails 4 and PG:UnableToSend error (connection pool? Timeout?)
I'm new to rails and its' ecosystem, and I'm deploying a rails 4 app on nginx/passenger, configured to access a remote postgres db. When a user first accesses the app, it encounters an error, but ...
1
vote
0answers
88 views
Active Record: Add metadata to attributes
I got the following problem: I have a rails4 application with a postgresql. The database contains data that is imported from different sources. These sources have different priorities (or ...
1
vote
0answers
121 views
Rails 4, Ruby 2.0: Get PG Error when trying to get all records having a specified value in joined table
Given the following two classes:
class VacationRequestDay < ActiveRecord::Base
belongs_to :vacation_request, :inverse_of => :vacation_request_days,
...
0
votes
0answers
684 views
PG::UndefinedTable: ERROR: relation “column_name” does not exist
I have the following error inside Heroku logs after I run pgbackups:restore:
PG::UndefinedTable: ERROR: relation "column_name" does not exist
When I run command pgbackups:restore, it seems that ...
0
votes
0answers
57 views
Radio button selection Rails - Across partials
I am trying to allow the user to pick one of the predictions out of the 7/8 (which are loaded with the predictions partial) as a double match (double points for anyone interested). I can't get it to ...
0
votes
0answers
165 views
Rails 4 polymorphic, self-join or ancestry?
I've got a Venue structure to create where you are able to place different types of components under different locations in the same Venue so the structures are like this:
Main Hall -> Conference ...
0
votes
0answers
78 views
Rails how to implement hierarchical associations
Is there a Rails way to implement hierarchical associations?
I'm currently trying to map below layout fields in database:
Product -> Product URL -> No Link
-> ...
0
votes
0answers
129 views
Postgres database has no password - can't get into pgadmin
I have a rails app using postgres. When I made the app, I never created a password. In my database.yml file, no password is listed. My application works, but I am trying to connect to the db using ...
0
votes
0answers
48 views
Rails dropped all of my tables unexpectedly
As far as I can tell, Rails just dropped and rebuilt all the tables in my development environment. I know what you're thinking, and I may be a klutz, but not that much of a klutz.
I was minding my ...
0
votes
0answers
83 views
Rails 4.0 multi-tenant app and after_commits: Executing outside the model's Postgres schema?
I have several after_commit hooks in my app that is multi-tenanted using Rails 4 and Postgres schemas. Today, I noticed that some of my hooks were being executed outside the model's actual schema, ...
0
votes
0answers
179 views
first_or_create not saving one column or attribute postgresql
folks.
When issuing the following code block in the controller, the resulting SQL does not include one column/attr of the model:
dev_total = DeviceTotal.where(time_stamp: ...
0
votes
0answers
38 views
pg_search with modified content
Does anyone know how to modify columns content before pg_search stores it?
Full explanation:
I have model Article with columns title and body. In body I store article's body html.
PgSearch is ...