Sha256: ce3970daa16e67ff05d876cec153098920e2a5e7ea1cd288d36d4b5c9b407964

Contents?: true

Size: 383 Bytes

Versions: 10

Compression:

Stored size: 383 Bytes

Contents

# frozen_string_literal: true

module Talkie
  class Subscription < ActiveRecord::Base
    belongs_to :subscriber, polymorphic: true, inverse_of: :subscriptions
    belongs_to :comment, inverse_of: :subscriptions, class_name: "Talkie::Comment"

    validates_presence_of :subscriber, :comment
    validates_uniqueness_of :comment, scope: [:subscriber_type, :subscriber_id]
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
talkie-0.5.1 app/models/talkie/subscription.rb
talkie-0.5.0 app/models/talkie/subscription.rb
talkie-0.4.1 app/models/talkie/subscription.rb
talkie-0.4.0 app/models/talkie/subscription.rb
talkie-0.3.5 app/models/talkie/subscription.rb
talkie-0.3.4 app/models/talkie/subscription.rb
talkie-0.3.3 app/models/talkie/subscription.rb
talkie-0.3.2 app/models/talkie/subscription.rb
talkie-0.3.1 app/models/talkie/subscription.rb
talkie-0.3.0 app/models/talkie/subscription.rb