Class: ActiveRecord::Base
- Inherits:
-
Object
- Object
- ActiveRecord::Base
- Defined in:
- lib/caboose/engine.rb
Direct Known Subclasses
Caboose::AbOption, Caboose::AbValue, Caboose::AbVariant, Caboose::Address, Caboose::ApprovalRequest, Caboose::Asset, Caboose::Block, Caboose::BlockType, Caboose::BlockTypeCategory, Caboose::BlockTypeSiteMembership, Caboose::BlockTypeSource, Caboose::BlockTypeSummary, Caboose::Calendar, Caboose::CalendarEvent, Caboose::CalendarEventGroup, Caboose::Category, Caboose::CategoryMembership, Caboose::CustomizationMembership, Caboose::DatabaseSession, Caboose::Discount, Caboose::Domain, Caboose::GiftCard, Caboose::LineItem, Caboose::MediaCategory, Caboose::MediaFile, Caboose::MediaImage, Caboose::Order, Caboose::OrderDiscount, Caboose::OrderPackage, Caboose::OrderTransaction, Caboose::Page, Caboose::PageCache, Caboose::PagePermission, Caboose::PageTag, Caboose::PermanentRedirect, Caboose::Permission, Caboose::Post, Caboose::PostCategory, Caboose::PostCategoryMembership, Caboose::Product, Caboose::ProductImage, Caboose::ProductImageVariant, Caboose::Review, Caboose::Role, Caboose::RoleMembership, Caboose::RolePermission, Caboose::SearchFilter, Caboose::Setting, Caboose::ShippingMethod, Caboose::ShippingPackage, Caboose::ShippingPackageMethod, Caboose::Site, Caboose::SiteMembership, Caboose::SmtpConfig, Caboose::SocialConfig, Caboose::StackableGroup, Caboose::StoreConfig, Caboose::TaxLine, Caboose::User, Caboose::Variant, Caboose::Vendor
Class Method Summary collapse
-
.pluq(field, compact = true, sort = true) ⇒ Object
(PLU)cks a single uni(Q)ue field.
Class Method Details
.pluq(field, compact = true, sort = true) ⇒ Object
(PLU)cks a single uni(Q)ue field
9 10 11 12 13 14 15 |
# File 'lib/caboose/engine.rb', line 9 def self.pluq(field, compact = true, sort = true) arr = self.uniq.pluck(field) return [] if arr.nil? arr = arr.compact if compact arr = arr.sort if sort return arr end |