Module: Models::SearchableView
- Extended by:
- ActiveSupport::Concern
- Included in:
- ViewAccountingTransmission, ViewActivity, ViewBudget, ViewCampaignDelivery, ViewCatalogItem, ViewCertification, ViewContact, ViewCoupon, ViewCreditApplication, ViewCreditMemo, ViewCustomer, ViewDelivery, ViewEmailTemplate, ViewEmployeeReview, ViewEstimatedLandedCost, ViewExchangeRate, ViewExpandedLineItem, ViewInventoryPlan, ViewInvoice, ViewItAsset, ViewItem, ViewItemCatalog, ViewItemLedgerEntry, ViewItemStat, ViewLeadTime, ViewLedgerEntry, ViewLineItem, ViewLineItemProfit, ViewLocatorRecord, ViewOpportunity, ViewOrder, ViewOutgoingPayment, ViewProductCatalog, ViewProductSpecificationValue, ViewPurchaseOrder, ViewQuote, ViewReceipt, ViewRma, ViewSalesByCustomer, ViewSalesCommission, ViewServiceJob, ViewStatementOfAccount, ViewSupplierItem, ViewSupportCase, ViewVoucher
- Defined in:
- app/concerns/models/searchable_view.rb
Overview
Formerly BaseViewForSearch
Defined Under Namespace
Modules: ClassMethods
Has one collapse
Instance Method Summary collapse
- #crm_link ⇒ Object
- #crm_link_subtitle ⇒ Object
- #has_columns?(*columns) ⇒ Boolean
- #readonly? ⇒ Boolean
Instance Method Details
#crm_link ⇒ Object
19 20 21 |
# File 'app/concerns/models/searchable_view.rb', line 19 def crm_link "/#{self.class.main_resource_table}/#{id}" end |
#crm_link_subtitle ⇒ Object
23 24 25 |
# File 'app/concerns/models/searchable_view.rb', line 23 def crm_link_subtitle crm_link end |
#has_columns?(*columns) ⇒ Boolean
27 28 29 |
# File 'app/concerns/models/searchable_view.rb', line 27 def has_columns?(*columns) columns.map(&:to_sym).all? { |column| !try(:send, column).nil? && try(:send, column).to_s.present? } end |
#main_resource ⇒ MainResource
10 |
# File 'app/concerns/models/searchable_view.rb', line 10 has_one :main_resource, class_name: main_resource_class, foreign_key: 'id' |
#readonly? ⇒ Boolean
31 32 33 |
# File 'app/concerns/models/searchable_view.rb', line 31 def readonly? true end |