Sha256: e83c53f2d74e4099aa330e6ca03becfd17d7c51aa5e10be50b4096548579ad83

Contents?: true

Size: 795 Bytes

Versions: 4

Compression:

Stored size: 795 Bytes

Contents

module Seedy
  class Emails < Record
    self.columns = {
      :team_id => :association,
      :id => :guid,
      :date_entered => :date_time,
      :date_modified => :date_time,
      :assigned_user_id => :association,
      :modified_user_id => :association,
      :created_by => :association,
      :deleted => 0,
      :date_sent => :date_time,
      :message_id => :guid,
      :name => :subject,
    }

    class << self
      def build(user, team, account)
        email = Emails.new
        email.associate(user,team)
        email
      end
    end
    
    def associate(user, team)
      write_attribute(:modified_user_id, user.id)
      write_attribute(:assigned_user_id, user.id)
      write_attribute(:team_id, team)
      write_attribute(:created_by, user.id)
    end
  end 
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
seedy-0.6.6 lib/seedy/records/emails.rb
seedy-0.6.5 lib/seedy/records/emails.rb
seedy-0.6.4 lib/seedy/records/emails.rb
seedy-0.6.3 lib/seedy/records/emails.rb