Tagged Questions
0
votes
1answer
24 views
How to update target table in FROM clause?
I prepared the following SQL statement in order to update the field master_id of the staging table with the id of the corresponding row of the master table. The master contains objects which are ...
0
votes
0answers
12 views
…mysql2/mysql2.so: [BUG] Segmentation fault ruby 2.0.0p247
I'm using windows7x64, ruby2.0.0p247, rails4.0.0 and mysql5.5.27.
When I run the $ rails server command, I got the following error.
...
0
votes
0answers
28 views
Rails Count and Group to return count and values
Using Rails 1.9.3.
Assume this example, simple table "cars" in MySQL
id | Model
1 | Ford
2 | Ford
3 | Mini
If I ran this query:
select count(*),model from cars group by model;
I would ...
0
votes
1answer
23 views
Bring value from one webpage to another webpage in Ruby on Rails website without database
Summary
I'm trying to bring a value from one webpage to another webpage on my Ruby on Rails site without saving it a second time into my MySQL database. I'm new to Ruby, so thanks in advance for your ...
0
votes
1answer
34 views
How can I include a field that is not part of the group clause in a ActiveRecord query?
(Ruby 1.9.3-p429; Rails 3.0.6)
Recent changes to the way we queue our tests have rendered our last_ids scope:
last_ids = tests.where('end_time != 0').
group(:condition1, :condition2, ...
0
votes
1answer
13 views
rake db:multi:migrate DATABASE=configuration error with JRuby, mysql, riak
JRuby 1.7.1 and Rails 3.2.11
In terminal I'm running "rake db:multi:migrate DATABASE=configuration" but I keep getting the error below meaning as far as I can tell that the configuration database is ...
0
votes
0answers
34 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 ...
1
vote
0answers
58 views
How do I iterate over an array with Ruby so that it saves individual records in MySQL?
In my HTML, I am able to return an array from a select multiple box using
<select multiple id="purchases" name="purchases[]">
<option value="purchase1">Shoes</option>
...
0
votes
2answers
24 views
Importing CSV files to database - Rejecting certain rows
If I want to import a csv file, which would include an email column, is there a way
to only accept rows that have a valid email format and reject rows that have invalid formats?
-1
votes
1answer
24 views
Mysql migration error
I'm recieveing the following error when trying to migrate my database.
Mysql2::Error: BLOB/TEXT column 'overview' can't have a default value: ALTER TABLE `habitat_versions` CHANGE `description` ...
-1
votes
0answers
17 views
Ruby on Rails and acid compliance with MySQL / Innodb
Is there a discussion of how well Rails supports ACID compliance (Rails 3.2.13 and MySQL 5.5)? Specifically, I'm looking for situations where a model is created and then other models are created ...
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
17 views
get values from sql in a rake task
I am looking to retrieve some values from my SQL database. In my rake task I need to check if a table has any values and if so I need to do them in a variable.
@db = ...
0
votes
1answer
25 views
Avoid default activerecord primary index creation
I am trying to workout how to advise/tell activerecord not to create it's primary index by default.
Anyone know how i can achieve this ?
class CreateHouse < ActiveRecord::Migration
def change
...
0
votes
1answer
28 views
Filtering MySQL data by rails session parameter
I've got a rails application, backed by MySQL. It's using a row-level permissions model. i.e. I have a few columns (permission1, permission2, permission3) on a table called projects and I need to ...