Sha256: b6492bdbc32d42f471b0b365ef5e50fac4fe4b214df6c3df64b5de306041b1e4

Contents?: true

Size: 712 Bytes

Versions: 4

Compression:

Stored size: 712 Bytes

Contents

module ExportFile
  def self.included(base)
    base.extend ClassMethods
  end

  module ClassMethods
    def enju_export_file_model
      include InstanceMethods
      belongs_to :user
      validates :user, presence: true
      attr_accessible :mode
      attr_accessor :mode
    end
  end

  module InstanceMethods
    def send_message
      sender = User.find(1)
      message_template = MessageTemplate.localized_template('export_completed', user.profile.locale)
      request = MessageRequest.new
      request.assign_attributes({:sender => sender, :receiver => user, :message_template => message_template}, as: :admin)
      request.save_message_body
      request.transition_to!(:sent)
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
enju_leaf-1.1.0.rc16 lib/enju_leaf/export_file.rb
enju_leaf-1.1.0.rc15 lib/enju_leaf/export_file.rb
enju_leaf-1.1.0.rc14 lib/enju_leaf/export_file.rb
enju_leaf-1.1.0.rc13 lib/enju_leaf/export_file.rb