Skip to content

Instantly share code, notes, and snippets.

@tatat
tatat / devise.ja.yml
Last active August 29, 2015 13:57 — forked from kawamoto/devise.ja.yml
とある案件用にカスタマイズさせていただきましたやつ
#SOURCE https://gist.github.com/tatat/9526513
ja:
devise:
confirmations:
confirmed: 'アカウントを登録しました。'
# confirmed: 'Your account was successfully confirmed. You are now signed in.'
send_instructions: '登録方法を数分以内にメールでご連絡します。'
# send_instructions: 'You will receive an email with instructions about how to confirm your account in a few minutes.'
send_paranoid_instructions: 'もしあなたのEメールアドレスが見つかった場合、本人確認についてのメールが数分以内に送られます。'
class Nyan
def behave_method(target, source)
(class << self; self end).module_exec do
alias_method "#{target}_original", target unless method_defined? "#{target}_original"
alias_method "#{source}_original", source unless method_defined? "#{source}_original"
alias_method target, "#{source}_original"
end
end
def with_behaving_method(a, b)
ActiveRecord::Base.connection.tables.each do |table_name|
next if %w|SchemaMigration Session|.include? table_name.classify
code = <<EOS
class #{table_name.classify} < ActiveRecord::Base
attr_accessible :#{table_name.classify.constantize.column_names.join(', :')}
end
EOS
`echo '#{code}' > app/models/#{table_name.singularize}.rb`
<!--[if IE]><script>
\               ¦         /
  \             ¦        /
             / ̄ ̄ ヽ,
            /        ',      /     _/\/\/\/|_
    \    ノ//, {☎}  /¨`ヽ {☎} ,ミヽ    /     \          /
     \ / く l   ヽ._.ノ   ', ゝ \       <   IE 死  >
     / /⌒ リ   `ー'′   ' ⌒\ \    /          \
     (   ̄ ̄⌒          ⌒ ̄ _)    ̄|/\/\/\/ ̄
      ` ̄ ̄`ヽ           /´ ̄