Kill trailing whitespace in ruby files

This commit is contained in:
小太
2013-03-19 23:10:10 +11:00
parent c107f96cec
commit cba839ba76
319 changed files with 2710 additions and 2710 deletions

View File

@@ -1,6 +1,6 @@
class CreateFavorites < ActiveRecord::Migration
TABLE_COUNT = 100
def self.up
# this is a dummy table and should not be used
create_table "favorites" do |t|
@@ -14,20 +14,20 @@ class CreateFavorites < ActiveRecord::Migration
check (user_id % 100 = #{i})
) inherits (favorites)
EOS
add_index "favorites_#{i}", :user_id
add_index "favorites_#{i}", :post_id
end
fragment = []
1.upto(TABLE_COUNT - 1) do |i|
fragment << <<-EOS
elsif (NEW.user_id % 100 = #{i}) then
insert into favorites_#{i} values (NEW.*);
EOS
end
execute <<-EOS
create or replace function favorites_insert_trigger()
returns trigger as $$
@@ -41,7 +41,7 @@ class CreateFavorites < ActiveRecord::Migration
$$
language plpgsql
EOS
execute <<-EOS
create trigger insert_favorites_trigger
before insert on favorites
@@ -51,7 +51,7 @@ class CreateFavorites < ActiveRecord::Migration
def self.down
drop_table "favorites"
0.upto(TABLE_COUNT - 1) do |i|
drop_table "favorites_#{i}"
end