GeneralScripting/pipedrive-ruby

View on GitHub
lib/pipedrive/organization.rb

Summary

Maintainability
A
0 mins
Test Coverage
module Pipedrive
  class Organization < Base

    def persons
      Person.all(get "#{resource_path}/#{id}/persons")
    end

    def deals
      Deal.all(get "#{resource_path}/#{id}/deals")
    end

    class << self

      def find_or_create_by_name(name, opts={})
        find_by_name(name).first || create(opts.merge(:name => name))
      end

    end
  end
end