Skip to content

Instantly share code, notes, and snippets.

View hfujimoto's full-sized avatar

Hiroshi Fujimoto hfujimoto

View GitHub Profile
@hfujimoto
hfujimoto / CommonNext
Created October 26, 2013 06:02
File at the app/models/concerns directory for Ruby On Rails. Find out previous and next resource of the collection
module CommonNext
extend ActiveSupport::Concern
def previous_record
self.class.unscoped.where('id < ?', self.id).order(:id).last
end
# Find Next Record Method
def next_record
self.class.unscoped.where('id > ?', self.id).order(:id).first
ja:
devise:
failure:
already_authenticated: 'あなたは既にログインしています。'
unauthenticated: '続けるには、ログインか、アカウントの登録が必要です。'
unconfirmed: '続けるには、アカウントの確認が必要です。'
locked: 'あなたのアカウントはロックされています。'
invalid: 'メールアドレスかパスワードが間違っています。'
invalid_token: '認証トークンが有効ではありません。'
timeout: 'セッションが切れました。再度ログインし直してください。'