Class: Integral::ApplicationRecord
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Integral::ApplicationRecord
- Defined in:
- app/models/integral/application_record.rb
Overview
Base Integral Model.
Direct Known Subclasses
Category, Enquiry, List, ListItem, ListItemConnection, NewsletterSignup, Notification::Notification, Notification::Subscription, Page, Post, PostViewing, ResourceAlternate, Role, RoleAssignment, Storage::File, User, Version, Webhook::Endpoint
Class Method Summary collapse
-
.available_statuses(opts = { reverse: false }) ⇒ Array
Containing available human readable statuses against there numeric value.
Class Method Details
.available_statuses(opts = { reverse: false }) ⇒ Array
Returns containing available human readable statuses against there numeric value.
7 8 9 10 11 12 13 |
# File 'app/models/integral/application_record.rb', line 7 def self.available_statuses(opts = { reverse: false }) available_statuses = statuses.map do |key, value| [I18n.t("integral.statuses.#{key}"), key] end opts[:reverse] ? available_statuses.each(&:reverse!) : available_statuses end |