migration
class AddUploadableToUploadFile < ActiveRecord::Migration[5.2]
def change
add_reference :upload_files, :uploadable, index: true
end
endmodels/upload_file.rb
| # copy from https://ruby-china.org/topics/24693 | |
| desc "Database related tasks" | |
| namespace :database do | |
| desc "Convert to utf8mb4" | |
| task convert_to_utf8mb4: :environment do | |
| connection = ActiveRecord::Base.connection | |
| database = connection.current_database | |
| connection.execute "ALTER DATABASE #{database} CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci;" |
| 1 | |
| 00:00:28,600 --> 00:00:38,390 | |
| 如果世上有一種眼神能比說話更能令人互相諒解 | |
| 2 | |
| 00:00:38,400 --> 00:00:48,300 | |
| 那麼所有人便能不再迷惘和平地活下去 | |
| 3 | |
| 00:00:48,310 --> 00:00:51,490 |
migration
class AddUploadableToUploadFile < ActiveRecord::Migration[5.2]
def change
add_reference :upload_files, :uploadable, index: true
end
endmodels/upload_file.rb
| <p><%= @supplier.name %>您好:</p> | |
| 下列連結是小院<%= @month %>月份的平台服務費金額,煩請依連結付款: | |
| <p>付費流程如下:</p> | |
| <a href="<%= @payment_link %>" target="_blank"><%= @payment_link %></a> | |
| <ol> | |
| <li>點選連結,確認資料無誤,送出資料,系統會產生一組轉帳帳號。</li> |
| /* | |
| This test code is write for Arduino AVR Series(UNO, Leonardo, Mega) | |
| If you want to use with LinkIt ONE, please connect the module to D0/1 and modify: | |
| // #include <SoftwareSerial.h> | |
| // SoftwareSerial s_serial(2, 3); // TX, RX | |
| #define sensor Serial1 | |
| */ |
出處:https://home.gamer.com.tw/creationDetail.php?sn=2927540
原始版本每一條的格式不太整齊,因此整理一下貼到這來ww
| 2015-01-03 05:41:08 中和-土城 | |
| 2015-01-03 05:43:56 土城-樹林 | |
| 2015-01-03 05:47:56 三鶯-鶯歌系統 | |
| 2015-01-03 05:49:38 鶯歌系統-大溪 | |
| 2015-01-03 05:53:53 大溪-龍潭 | |
| 2015-01-03 05:56:28 龍潭-關西服務區 | |
| 2015-01-03 06:00:47 關西服務區-關西 | |
| 2015-01-03 06:03:56 關西-竹林 | |
| 2015-01-03 06:09:47 竹林-寶山 | |
| 2015-01-03 06:11:34 寶山-新竹系統 |
| const moment = require('moment') | |
| const ecpay_payment = require('ecpay-payment') | |
| function getAddress (invoice) { | |
| if (invoice.string_address) { | |
| return invoice.string_address | |
| } | |
| var address = '' | |
| try { |