1
vote
0answers
45 views
Rails looking for Nonexistent ID column in schema_migrations table during initial migrartion
Running migration on a fresh db results in the following error.
>> rake db:drop; rake db:create:all; rake db:migrate
...
1
vote
0answers
26 views
how to set rails validates uniqueness on column hstore key?
I have a table channels, with an hstore column credentials. The credentials for each channel might be different, but I want them to be unique when populated. I have set some postgres indexes like ...
1
vote
0answers
38 views
Rails Postgresql Time Column
I've got 2 Time Without Time Zone columns in my table (start_time and end_time). When an event occurs, I need to see which of these columns has a start_time < Time.now < end_time. The problem ...
1
vote
0answers
63 views
Heroku + Rails 3.2 + PostgreSQL = NoMethodError: undefined method `result' for #<NoMethodError:..>
NoMethodError: undefined method `result' for #< NoMethodError: ...>
Stack trace refers to this place:
def current_income
return @current_income if defined? @current_income
if ...
1
vote
0answers
131 views
Calling PL/pgSQL Stored Procedures from Ruby on Rails
I am working on a project where I am the database designer/admin in a PostgreSQL environment. The leader has decided to use Rails for the application logic and recruited a Rails programmer.
The Rails ...
0
votes
0answers
7 views
How to resolve “could not find compatible versions for gem ”rake“ , when using dm-pg-types and (sass-rails, coffee-rails) gems together”
I started migrating my Sinatra app to Rails app and in process of changing the GEM file of a new Rails installation.
I am using dm-pg-types and seems like it requires older version of rails , which ...
0
votes
0answers
31 views
nesting another field in a json column with a rails form
I'm trying to use the Json type available in the Postgres 9.2 release as a means to store a variety of data in one field. I created a column called data of json type on the corrections table. The form ...
0
votes
0answers
36 views
Rails Mysql to Postgresql Float
I'm transferring my database from mysql to postgresql.
I have a latitude and longitude column for one of my models:
t.float :latitude
t.float :longitude
I'm using mysql2psql gem to load the ...
0
votes
0answers
43 views
Postgresql prepared statement in Rails : PG::Error: ERROR: bind message supplies 1 parameters, but prepared statement “a4” requires 0
I have introduced a new field to a model file in my 4.0.0 Ruby on Rails application and added a validation to make sure it is unique using the following line:
validates_uniqueness_of :source_id
...
0
votes
0answers
18 views
Rails 4 Heroku Mysql to Postgres Dump Pending Migrations
I've converted my mysql db to postgres.
I'm used the following to import it to the db:
heroku pgbackups:restore database 'http://app.com' --app
This creates all the tables and imports the data.
...
0
votes
0answers
29 views
Foreign key associations in Rails with Postgres array possible?
Given the following Tweet:
# db/schema.rb
create_table "tweets", force: true do |t|
t.integer "project_id", null: false
t.integer "author_id", null: false
t.integer ...
0
votes
0answers
11 views
Postgres searching domains with prefixes and english dictionary
I am using Postgres search through the Ruby gem pg_search. One of the columns I'm searching against contains domain names, such as "amazon.com", using a simple dictionary and prefixes I get the ...
0
votes
0answers
26 views
RoR Application built using spree works fine in local not in heroku
I have an ROR application thats about an year old so it uses older versions of multiple spree dependencies but i have ensured that it works perfectly and as expected without any dependency issues in ...
0
votes
0answers
11 views
Extracting API into another heroku app. Best practice
I'm planning on extracting some API endpoints from a Rails app hosted on Heroku that uses Postgres into a new Heroku app. What is the advisable way to do this?
Share the database with the 2nd app ...
0
votes
0answers
19 views
Data not saved with attr_encryptor
I would like to encrypt data in my project so I use https://github.com/danpal/attr_encryptor
I use this gem like this for my User model for example :
attr_accessible :name, :mail
attr_accessor :name
...