Sha256: 7b1e15f34d9e1b70e01247ed637ec2e07c20686a4ad8433e3565654fa2ce46f3

Contents?: true

Size: 392 Bytes

Versions: 11

Compression:

Stored size: 392 Bytes

Contents

class CommentSubscriber < ActiveRecord::Base
  validates_presence_of :email, :commentable
  validates_uniqueness_of :email, :scope => [:commentable_id, :commentable_type]
  belongs_to :commentable, :polymorphic => true
  
  # open up everything for mass assignment
  attr_protected

  def list(object)
    self.where(:commentable_id => object.id, :commentable_type => object.class)
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
forge-cli-0.1.10 lib/forge/app/models/comment_subscriber.rb
forge-cli-0.1.9 lib/forge/app/models/comment_subscriber.rb
forge-cli-0.1.8 lib/forge/app/models/comment_subscriber.rb
forge-cli-0.1.7 lib/forge/app/models/comment_subscriber.rb
forge-cli-0.1.6 lib/forge/app/models/comment_subscriber.rb
forge-cli-0.1.5 lib/forge/app/models/comment_subscriber.rb
forge-cli-0.1.4 lib/forge/app/models/comment_subscriber.rb
forge-cli-0.1.3 lib/forge/app/models/comment_subscriber.rb
forge-cli-0.1.2 lib/forge/app/models/comment_subscriber.rb
forge-cli-0.1.1 lib/forge/app/models/comment_subscriber.rb
forge-cli-0.1.0 lib/forge/app/models/comment_subscriber.rb