Tagged Questions
1
vote
0answers
29 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
22 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
32 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
62 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
119 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
14 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
16 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
18 views
ActiveRecord Cannot save a record: “zero-length delimited identifier”
I'm working on a project that allows users to rate recipes. I made a simple join table (RecipeRating) that User and Recipe both share, but ActiveRecord is having trouble saving.
@rating = ...
0
votes
0answers
24 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
10 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
24 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
...
0
votes
0answers
34 views
When i run: heroku run rake db:migrate
When I am pushing my project to Heroku where I'm using PostgreSQL as the database, I get an error:
sorry something went wrong.
Then I run:
heroku run rake db:migrate
and I get these errors:
...
0
votes
0answers
16 views
pg_search searching with dictionary: “spanish” not working
This is my scope
pg_search_scope :simple_search, lambda {|args, query|
return {:against => args,
:query => query,
using: { tsearch: { dictionary: "spanish"}} }
}
this ...