Module: ExportFile
- Extended by:
- ActiveSupport::Concern
- Included in:
- UserExportFile
- Defined in:
- app/models/concerns/export_file.rb
Instance Method Summary collapse
Instance Method Details
#send_message ⇒ Object
10 11 12 13 14 15 16 17 18 19 |
# File 'app/models/concerns/export_file.rb', line 10 def sender = User.find(1) #system locale = user.profile.try(:locale) || I18n.default_locale.to_s = MessageTemplate.localized_template('export_completed', locale) request = MessageRequest.new request.assign_attributes({sender: sender, receiver: user, message_template: }) request. request.save! request.transition_to!(:sent) end |