Sha256: 4c5e5218a2859e46eaf17aa2571e55b860a67e43e20432dae42e11097ef11c43

Contents?: true

Size: 799 Bytes

Versions: 6

Compression:

Stored size: 799 Bytes

Contents

class Subscribe < ActiveRecord::Base
  attr_accessible :subscription_id, :work_id, :start_at, :end_at
  belongs_to :subscription, :counter_cache => true, validate: true
  belongs_to :work, class_name: 'Manifestation', validate: true

  validates_associated :subscription, :work
  validates_presence_of :subscription, :work, :start_at, :end_at
  validates_uniqueness_of :work_id, scope: :subscription_id
end

# == Schema Information
#
# Table name: subscribes
#
#  id              :integer          not null, primary key
#  subscription_id :integer          not null
#  work_id         :integer          not null
#  start_at        :datetime         not null
#  end_at          :datetime         not null
#  created_at      :datetime         not null
#  updated_at      :datetime         not null
#

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
enju_library-0.1.0.pre39 app/models/subscribe.rb
enju_library-0.1.0.pre38 app/models/subscribe.rb
enju_library-0.1.0.pre37 app/models/subscribe.rb
enju_library-0.1.0.pre36 app/models/subscribe.rb
enju_library-0.1.0.pre35 app/models/subscribe.rb
enju_library-0.1.0.pre34 app/models/subscribe.rb