Sha256: 1af79162b1798dfcebc0927758a2cfefe819100f21096a721ea35ddfbd09a752

Contents?: true

Size: 488 Bytes

Versions: 15

Compression:

Stored size: 488 Bytes

Contents

# frozen_string_literal: true

module Maglev
  class Site < ApplicationRecord
    ## concerns ##
    include Maglev::Site::LocalesConcern
    include Maglev::SectionsConcern
    include Maglev::Translatable

    ## translations ##
    translates :sections

    ## validations ##
    validates :name, presence: true

    ## methods ##
    def api_attributes
      %i[id name]
    end

    def find_section(type)
      sections&.find { |section| section['type'] == type }
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
maglevcms-1.2.2 app/models/maglev/site.rb
maglevcms-1.2.1 app/models/maglev/site.rb
maglevcms-1.2.0 app/models/maglev/site.rb
maglevcms-1.1.7 app/models/maglev/site.rb
maglevcms-1.1.6 app/models/maglev/site.rb
maglevcms-1.1.5 app/models/maglev/site.rb
maglevcms-1.1.4 app/models/maglev/site.rb
maglevcms-1.1.3 app/models/maglev/site.rb
maglevcms-1.1.2 app/models/maglev/site.rb
maglevcms-1.1.1 app/models/maglev/site.rb
maglevcms-1.1.0 app/models/maglev/site.rb
maglevcms-1.0.0 app/models/maglev/site.rb
maglevcms-1.0.0.rc3 app/models/maglev/site.rb
maglevcms-1.0.0.rc2 app/models/maglev/site.rb
maglevcms-1.0.0.rc1 app/models/maglev/site.rb