Sha256: ef361a39708477f247c37ccb7381a26003f39ad70b89cd0b80fb245cd4940c6f

Contents?: true

Size: 613 Bytes

Versions: 1

Compression:

Stored size: 613 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

  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-2.5.0 test/support/models.rb