Sha256: 7dff6477d8ddd017a0083352aefc28c1016e0fec167dd9bc29bd1ff7956613c4

Contents?: true

Size: 496 Bytes

Versions: 1

Compression:

Stored size: 496 Bytes

Contents

module Mautic
  class Contact < Model

    alias_attribute :first_name, :firstname
    alias_attribute :last_name, :lastname
    def self.in(connection)
      Proxy.new(connection, endpoint, default_params: { search: '!is:anonymous' })
    end

    def name
      "#{firstname} #{lastname}"
    end

    def assign_attributes(source = nil)
      super
      self.attributes = {
        tags: (source['tags'] || []).collect{|t| Mautic::Tag.new(@connection, t)}
      } if source
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mautic-2.2.2 app/models/mautic/contact.rb