Class: ApplicationRecord
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- ApplicationRecord
- Defined in:
- app/models/application_record.rb
Direct Known Subclasses
Account, Activity, ActivityAgenda, ActivityChainType, ActivityResultType, ActivityType, ActivityTypeAssignmentQueue, ActivityTypeRule, AdditionalCallCredit, Address, Agreement, AgreementParticipant, AiUsageLog, AmazonAPlusContent, AmazonBrowseNode, AmazonCatalogItemFlag, AmazonCompetitor, AmazonMarketplace, AmazonSchema, AmazonTransparencyCode, AmazonVariation, Analytic::BudgetDimension, Analytic::BudgetFact, Analytic::DateTimeDimension, Analytic::ItemDemandFact, Analytic::ItemDimension, Analytic::ItemSoldFact, Analytic::OrdersSoldFact, Analytic::ReportGroupingDimension, Analytic::SalesRepDimension, AnalyticsSqlAuditLog, ApiAuthentication, ApiConsumer, ApplicationViewRecord, Appraisal, AreaCode, Article, ArticlePage, ArticleRevision, AssignmentQueue, AssistantBrainEntry, AssistantConversation, AssistantConversationShare, AssistantMessage, AssistantToolCall, AssortmentInstruction, Authentication, AverageMonthlyTemperature, Bank, BankAccount, BankBalanceStatement, Brand, Budget, BudgetGroup, BudgetRule, BusinessUnit, BuyingGroup, CallBlock, CallLog, CallLogEvent, CallRailData, CallRecord, Campaign, CampaignAction, CampaignDelivery, CanadianTireStoreAddress, Carrier, CarrierPickup, Catalog, CatalogItem, CatalogItemRetailerProbe, Ceiling, CeilingInsulationType, CeilingType, Certification, Charity, Check, City, CliftonStrength, CommissionRate, CommissionStructure, CommissionStructureEntry, CommissionTier, Communication, CommunicationRecipient, CommunicationRecipientEmailLink, Company, CompanyHoliday, ContactForm, ContactPoint, ContentEmbedding, ContentLink, Country, Coupon, CouponSerialNumber, Course, CourseCategory, CourseEnrollment, CourseExam, CreditApplication, CreditCardVault, CreditMemo, CspReport, CustomerDropEvent, CustomerFilter, CustomerRecord, CycleCount, CycleCountItem, DataDictionary, DataDictionarySet, DataImport, DataImportCell, DataImportColumn, DataImportRow, Delivery, DesignToolFixture, DigitalAsset, DigitalAssetProductLine, DigitalAssetsDuplicate, Discount, DoNotCall, Door, DoorCoreType, DoorFrameType, DoorInsulationType, DoorType, DownloadToken, EdiCommunicationLog, EdiDocument, ElementPoleAssignment, EmailLink, EmailPreference, EmailTemplate, EmbeddedAsset, EmployeeEvent, EmployeeEventsEmailSetting, EmployeeGoal, EmployeePhoneStatus, EmployeePhoneStatusChange, EmployeeRecord, EmployeeReview, EmployeeSurveyEnrollment, EmployeeTimeOff, EmployeeWorkSchedule, Event, ExchangeRate, ExclusiveItemGroup, ExportedCatalogItem, ExportedCatalogItemImage, ExportedCatalogItemPacket, ExportedCatalogItemPacketAttribute, ExportedCatalogItemPacketImageAttribute, ExteriorWall, ExteriorWallInsulationType, ExteriorWallType, Facet, FacetsProductCategories, FacetsProductLines, Feed, FeedHistory, FloorPlanDisplay, FloorPlanDisplayDigitalAsset, FloorType, FraudReport, GeneratedImage, GoogleFeed, HarmonizationCode, HeatingElementProductLineOption, HistoricalOpenActivity, IdentificationNumber, ImageDuplicatePair, ImageProfile, InstalledItem, InventoryCommit, Invoice, IqAccessoryFilter, ItAsset, Item, ItemDemandForecast, ItemDemandForecastAddition, ItemLedgerEntry, ItemProductLine, ItemRelation, Kpi, LandedCost, LedgerAccount, LedgerBeginningBalance, LedgerClosingPeriod, LedgerCompanyAccount, LedgerEntry, LedgerProject, LedgerTransaction, LegacyActivityResult, LiabilityInsurance, LineDiscount, LineItem, LinkCheck, LiveEvent, LlmModel, LocatorBlackListParty, LocatorRecord, LocatorWhiteListParty, LoginActivity, MailActivity, Mailing, Manifest, MaterialAlert, MaterialAlertItem, MessagingLog, NotificationChannel, OauthCredential, OnlineOfflineUser, OpenaiFeed, Opportunity, OpportunityParticipant, Order, OrderTransaction, OutgoingPayment, OutgoingPaymentItem, Packaging, Packing, Party, PartyTopic, Payment, PostComment, PostalCode, PostalCodeStatistic, Praise, PriceThreshold, PrintProfile, Printer, ProductCategory, ProductFilter, ProductLine, ProductSpecification, ProductTaxCode, Profile, PublicationItem, PurchaseOrder, PurchaseOrderItem, PurchaseOrderShipment, QeAccessStatistic, QeDataStatistic, QueueCallLog, QuickEstimator, Quote, Receipt, ReceiptDetail, RedactorDragonfly::Attach, RelatedImage, ReservedSerialNumber, ResourceTaxRate, Review, ReviewsIo, ReviewsIoImage, ReviewsIoVideo, RewardAllocation, RhcParamSet, Rma, RmaItem, RmaReasonCode, Role, RoomPlan, RoomPlanFixture, RoomType, SalesCommission, SalesCommissionNetBase, SalesCommissionNetBaseDetail, SalesForecast, SalesGoal, SalesRepQueue, SalesRepQueueEntry, SalesRepWeight, SchedulerBooking, SchedulerBookingPage, SchedulerBookingQuestion, SchedulerHost, SchedulerProfile, Search, SearchResult, SeoBatchItem, SeoBatchJob, SeoPageKeyword, SerialNumber, ServiceJob, Shipment, ShipmentContent, ShipmentItem, ShipmentReceipt, ShipmentReceiptItem, ShippingAccountNumber, ShippingCost, ShippingOption, Showcase, ShowcaseDigitalAsset, ShowcaseFaq, ShowcaseLegacy, ShowcaseRoomLegacy, SiteMap, SiteMapDataPoint, SiteMapLink, SiteMapRecommendation, Skylight, SkylightFrameType, SkylightGlassType, SkylightInsulationType, SmsBlock, SmsMessage, Source, SpeedeeDasZip, SpeedeeManifest, SpeedeeManifestShipment, SpeedeeRate, SpeedeeService, SpeedeeZone, Spiff, SpiffEnrollment, SpiffReward, SpiffRewardThreshold, SqlRepo, StandaloneDelivery, State, StatementOfAccount, StatisticsByZip, StorageLocation, Store, StoreItem, StoreItemAudit, StoreTransfer, StrengthTheme, SubFloorType, Subscriber, SubscriberList, SupplierItem, SupplierItemPrice, SupportCase, SupportCaseParticipant, Survey, SurveyEnrollment, Tag, Tagging, TaxExemption, TaxRate, Thumb, TimeOffBalance, TimeOffBlockedDay, TimeOffPolicy, TimeOffPolicyAssignment, TimeOffRequest, TimeOffRequestDate, TimeOffType, Topic, TopicCategory, TopicExam, TopicResponse, TradeShow, TranslationKey, TranslationKeyResource, TranslationText, UnderFloor, UnderFloorInsulationType, UnderFloorType, Upload, UpsIncorrectV1471aChargeData, UpsV1471aInvoiceData, UpscaleProposal, VariableCost, Visit, VisitEvent, Voltage, Vote, Voucher, VoucherItem, WarehousePackage, WayfairSchema, WebhookEvent, WebhookLog, Window, WindowFrameType, WindowGlassType, WindowInsulationType, WindowType, WorkSchedule, WorkScheduleDay, XrateAverage, Zone
Class Method Summary collapse
-
.ransackable_associations(_auth_object = nil) ⇒ Object
ransackable_associationsby default returns the names of all associations as an array of strings. -
.ransackable_attributes(_auth_object = nil) ⇒ Object
ransackable_attributesby default returns all column names and any defined ransackers as an array of strings. -
.ransackable_scopes(_auth_object = nil) ⇒ Object
ransackable_scopesby default returns an empty array i.e. -
.ransortable_attributes(auth_object = nil) ⇒ Object
ransortable_attributesby default returns the names of all attributes available for sorting as an array of strings.
Instance Method Summary collapse
Methods included from Models::EventPublishable
Class Method Details
.ransackable_associations(_auth_object = nil) ⇒ Object
ransackable_associations by default returns the names
of all associations as an array of strings.
For overriding with a whitelist array of strings.
23 24 25 |
# File 'app/models/application_record.rb', line 23 def self.ransackable_associations(_auth_object = nil) reflect_on_all_associations.map { |a| a.name.to_s } end |
.ransackable_attributes(_auth_object = nil) ⇒ Object
ransackable_attributes by default returns all column names
and any defined ransackers as an array of strings.
For overriding with a whitelist array of strings.
15 16 17 |
# File 'app/models/application_record.rb', line 15 def self.ransackable_attributes(_auth_object = nil) column_names + _ransackers.keys end |
.ransackable_scopes(_auth_object = nil) ⇒ Object
ransackable_scopes by default returns an empty array
i.e. no class methods/scopes are authorized.
For overriding with a whitelist array of symbols.
39 40 41 |
# File 'app/models/application_record.rb', line 39 def self.ransackable_scopes(_auth_object = nil) [] end |
.ransortable_attributes(auth_object = nil) ⇒ Object
ransortable_attributes by default returns the names
of all attributes available for sorting as an array of strings.
For overriding with a whitelist array of strings.
31 32 33 |
# File 'app/models/application_record.rb', line 31 def self.ransortable_attributes(auth_object = nil) ransackable_attributes(auth_object) end |
Instance Method Details
#to_relation ⇒ Object
43 44 45 |
# File 'app/models/application_record.rb', line 43 def to_relation self.class.where(id: id) end |