Sha256: 3911d39d2d60fd63249f8edd9ee037be1410e5468eb043173d762fcf123d98b9

Contents?: true

Size: 566 Bytes

Versions: 18

Compression:

Stored size: 566 Bytes

Contents

module ExportFile
  extend ActiveSupport::Concern

  included do
    belongs_to :user
    validates :user, presence: true
    attr_accessor :mode
  end

  def send_message
    sender = User.find(1) #system
    locale = user.profile.try(:locale) || I18n.default_locale.to_s
    message_template = MessageTemplate.localized_template('export_completed', locale)
    request = MessageRequest.new
    request.assign_attributes({sender: sender, receiver: user, message_template: message_template})
    request.save_message_body
    request.transition_to!(:sent)
  end
end

Version data entries

18 entries across 16 versions & 2 rubygems

Version Path
enju_library-0.2.5 app/models/concerns/export_file.rb
enju_library-0.2.4 app/models/concerns/export_file.rb
enju_library-0.2.3 app/models/concerns/export_file.rb
enju_leaf-1.2.1 vendor/bundle/ruby/2.3/gems/enju_library-0.2.2/app/models/concerns/export_file.rb
enju_leaf-1.2.1 vendor/bundle/ruby/2.3/gems/enju_library-0.2.1/app/models/concerns/export_file.rb
enju_leaf-1.2.1 vendor/bundle/ruby/2.3/bundler/gems/enju_library-d36f415e177e/app/models/concerns/export_file.rb
enju_library-0.2.2 app/models/concerns/export_file.rb
enju_library-0.2.1 app/models/concerns/export_file.rb
enju_library-0.2.0 app/models/concerns/export_file.rb
enju_library-0.2.0.beta.10 app/models/concerns/export_file.rb
enju_library-0.2.0.beta.9 app/models/concerns/export_file.rb
enju_library-0.2.0.beta.8 app/models/concerns/export_file.rb
enju_library-0.2.0.beta.7 app/models/concerns/export_file.rb
enju_library-0.2.0.beta.6 app/models/concerns/export_file.rb
enju_library-0.2.0.beta.5 app/models/concerns/export_file.rb
enju_library-0.2.0.beta.4 app/models/concerns/export_file.rb
enju_leaf-1.2.0.beta.2 app/models/concerns/export_file.rb
enju_leaf-1.2.0.beta.1 app/models/concerns/export_file.rb