Sha256: 2f771843591a87f2c93a271aff0c96c7931126de8a6d705c0066fb3eeae9bc4b

Contents?: true

Size: 687 Bytes

Versions: 1

Compression:

Stored size: 687 Bytes

Contents

class User < ActiveRecord::Base
end

class Label < ActiveRecord::Base
  belongs_to :issue
end

class Issue < Superstore::Base
  attribute :description, type: :string
  attribute :title, type: :string
  attribute :parent_issue_id, type: :string
  attribute :comments, type: :json
  attribute :created_at, type: :time
  attribute :updated_at, type: :time

  before_create { self.description ||= 'funny' }

  has_many :labels, inverse_of: :issue
  has_many :children_issues, class_name: 'Issue', foreign_key: :parent_issue_id, inverse_of: :parent_issue, superstore: true
  belongs_to :parent_issue, class_name: 'Issue', superstore: true

  def self.for_key key
    where_ids(key)
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
superstore-3.0.0 test/support/models.rb