27 Mar '13, 2am

[Rails]migrationで複数のALTER文を1回にまとめる方法 / “has_many :bugs, :through => :rails”

Bulk ALTER TABLE with Rails 3 and MySQL Published about 2 years ago With this commit , Rails migrations will support adding/removing/changing multiple columns via a single ALTER TABLE statement for MySQL. Let’s say you need to add 2 new columns to a table and modify data type of another column. Normally, you’d do something like this from a migration: change_table(:users ) do |t| t.string :im_handle t.belongs_to :company t.change :birthdate , :datetime end The above translates to 3 separate ALTER TABLE statements: ALTER TABLE `users` ADD `im_handle` varchar(255) ALTER TABLE `users` ADD `company_id` int(11) ALTER TABLE `users` CHANGE `updated_at` `updated_at` datetime DEFAULT NULL Now if you read the relevant MySQL documentation , it’s a little fucked up how ALTER TABLE works. But in a nutshell, here’s what MySQL does. 1. Write lock the table. So no more INSERT or UPDATE . 2...

Full article: http://m.onkey.org/bulk-alter-table-with-rails-3-and-mysql

Tweets

Batches#find_in_batches - When dealing with has...

apidock.com 27 Mar '13, 7pm

You can control the starting point for the batch processing by supplying the :start option. This is especially useful if y...

Rails' Insecure Defaults

rubyflow.com 27 Mar '13, 1pm

Rails' Insecure Defaults Posted by brynary on March 27, 2013 — 0 comments Just published a detailed blog post covering 13 ...

Git-subtree and Rails

rubyflow.com 28 Mar '13, 9am

Git-subtree and Rails Posted by alexandrov on March 28, 2013 — 0 comments I just wrote about how we used git-subtree to sh...

Raising and Rescuing Custom Errors in Rails

rubyflow.com 27 Mar '13, 9am

Raising and Rescuing Custom Errors in Rails Posted by joshnesbitt on March 27, 2013 — 0 comments Following on from our pos...

DateTime - Edge case #rails

apidock.com 29 Mar '13, 6am

No documentation This class has no description. You can help the Ruby on Rails community by adding new notes. Show files w...

Rails date method distance_of_time_in_words

api.rubyonrails.org 31 Mar '13, 2pm

:use_month_numbers - Set to true if you want to use month numbers rather than month names (e.g. "2" instead of "February")...

Recluiters per #ruby #rails da #irland #uk #ber...

ruby-forum.com 26 Mar '13, 6pm

Ho ricevuto questo, abbastanza dettagliato in termini di $$$ e benefici. Naturalmente il costo della vita e` piu` alto la`...

has_many :bugs, :through => :rails

m.onkey.org 22 Mar '13, 10pm

has_many :bugs, :through => :rails Using ruby-debug with Pow Published over 1 year ago After moving to Sam Stephenson’s aw...

Flatui::Rails gem

rubyflow.ru 26 Mar '13, 4am

Flat UI - это набор UI компонентов от Designmodo , выполненный в популярном в настоящее время "плоском" стиле. В качестве ...

Notification APIの使い方〜 / “#249 Notifications in ...

railscasts.com 29 Mar '13, 5am

start_processing.action_controller notification: sql.active_record notification: sql.active_record notification: sql.activ...

[Rails] / “#400 What's New in Rails 4 - RailsCa...

railscasts.com 04 Apr '13, 1pm

The next major version of Rails is just around the corner and as this is episode 400 it seems like a good time to discuss ...

TimeWithZone#between? - Edge case #rails

apidock.com 29 Mar '13, 6am

This method has no description. You can help the Ruby on Rails community by adding new notes.

Should you upgrade Rails from 3.2.12 to 3.2.13?

rubyflow.com 25 Mar '13, 7pm

Should you upgrade Rails from 3.2.12 to 3.2.13? Posted by gravis on March 25, 2013 — 0 comments If you wonder if you shoul...

A quick reference for Rails datatypes

guides.rubyonrails.org 31 Mar '13, 2am

Internally Rails only uses the migration’s number (the timestamp) to identify them. Prior to Rails 2.1 the migration numbe...

git-subtree и Rails

rubyflow.ru 28 Mar '13, 12pm

Написал в блоге про использование git-subtree для расширивания кода между Rails приложениями: http://igor-alexandrov.githu...