Class: Brand
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- Brand
- Defined in:
- app/models/brand.rb
Overview
== Schema Information
Table name: brands
Database name: primary
id :bigint not null, primary key
description :text
name :string not null
tagline :string
created_at :datetime not null
updated_at :datetime not null
company_id :bigint
image_id :integer
Indexes
index_brands_on_company_id (company_id)
Foreign Keys
fk_rails_... (company_id => companies.id)
fk_rails_... (image_id => digital_assets.id)
Belongs to collapse
Has many collapse
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from ApplicationRecord
ransackable_associations, ransackable_attributes, ransackable_scopes, ransortable_attributes, #to_relation
Methods included from Models::EventPublishable
Class Method Details
.warmlyyours ⇒ Object
42 43 44 |
# File 'app/models/brand.rb', line 42 def self.warmlyyours find_by_name('WarmlyYours') end |
Instance Method Details
#items ⇒ ActiveRecord::Relation<Item>
28 |
# File 'app/models/brand.rb', line 28 has_many :items, dependent: :nullify |
#schema_dot_org_structure ⇒ Object
32 33 34 35 36 37 38 39 40 |
# File 'app/models/brand.rb', line 32 def schema_dot_org_structure SchemaDotOrg::Brand.new( name: name, slogan: tagline, logo: image.image_url #As of 12-4-22 google doesn't seem to like a rating in here #aggregateRating: company.schema_dot_org_aggregate_rating ) end |