Sha256: 73d6aa3cdc89bfb9db70836033053cd9e742cb597dcf8e9baf1de4ed332e2261
Contents?: true
Size: 778 Bytes
Versions: 2
Compression:
Stored size: 778 Bytes
Contents
module IntercomRails module Proxy class Company < Proxy def self.current_in_context(search_object) begin if config.current.present? company_proxy = new(search_object.instance_eval(&config.current), search_object) return company_proxy if company_proxy.valid? end rescue NameError end raise NoCompanyFoundError end def valid? company.present? && company.respond_to?(:id) && company.id.present? end def standard_data hsh = {} hsh[:id] = company.id hsh[:name] = company.name if attribute_present?(:name) hsh[:created_at] = company.created_at if attribute_present?(:created_at) hsh end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
intercom-rails-0.2.2 | lib/intercom-rails/proxy/company.rb |
intercom-rails-0.2.1 | lib/intercom-rails/proxy/company.rb |