Sha256: 978b95715de785188863e1d395c2eaf36a99ab4c2f60889d82856ee3b2ea8d15

Contents?: true

Size: 597 Bytes

Versions: 2

Compression:

Stored size: 597 Bytes

Contents

# frozen_string_literal: true

# == Schema Information
#
# Table name: alchemy_folded_pages
#
#  id      :integer          not null, primary key
#  page_id :integer          not null
#  user_id :integer          not null
#  folded  :boolean          default(FALSE)
#

module Alchemy
  class FoldedPage < ActiveRecord::Base
    belongs_to :page, required: true
    belongs_to :user, required: true,
      class_name: Alchemy.user_class_name

    def self.folded_for_user(user)
      return none unless Alchemy.user_class < ActiveRecord::Base
      where(user: user, folded: true)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
alchemy_cms-4.0.6 app/models/alchemy/folded_page.rb
alchemy_cms-4.0.5 app/models/alchemy/folded_page.rb