:authors, :name, false end end ! class ChangeNameToNotNullOnAuthors < ActiveRecord::Migration def change change_column :authors, :name, :string, null: false end end # => ActiveRecord::IrreversibleMigration
do |comment| if message.blank? errors.add(:base, 'You need a message!', strict: true) end end end ! > Comment.new.valid? # ActiveModel::StrictValidationFailed: You need a message!
# Subject can be set in your I18n file at config/locales/en.yml # with the following lookup: # # en.notifier.new_article.subject # def new_article @greeting = "Hi" ! mail to: "[email protected]" end end
# Subject can be set in your I18n file at config/locales/en.yml # with the following lookup: # # en.notifier.new_article.subject # def new_article @greeting = "Hi" ! mail to: "[email protected]" end end
def new_article @greeting = "Hi" ! mail to: "[email protected]", subject: I18n.t('subjects.new_article') end end en: subjects: new_article: 'New article just published.'
def new_article @greeting = "Hi" ! mail to: "[email protected]", subject: default_i18n_subject(title: 'Clarity is king') end end en: notifier: new_article: subject: 'New article: %{title}.'