Sha256: 19c4358c8ec2c6dbc09db78eb47427bdf666616f2db581fc37588b1bf14b10f4

Contents?: true

Size: 445 Bytes

Versions: 7

Compression:

Stored size: 445 Bytes

Contents

# A model to contain mentions of the :owner in the media
class Mention < ActiveRecord::Base
  belongs_to :owner, :polymorphic => true

  scope :since, lambda { |d| where(["mentions.date > ?", d]) }

  # Returns the mentions in JSON form
  # 
  # @params [Hash] A hash of options
  # @return The mentions in JSON form
  def as_json(opts = {})
    default_opts = {:except => [:owner_id, :owner_type]}
    super(default_opts.merge(opts))
  end
end

Version data entries

7 entries across 4 versions & 2 rubygems

Version Path
govkit-0.7.4 lib/generators/govkit/templates/mention.rb
govkit-0.7.4 generators/govkit/templates/mention.rb
govkit-0.7.3 lib/generators/govkit/templates/mention.rb
govkit-0.7.3 generators/govkit/templates/mention.rb
govkit-0.7.2 generators/govkit/templates/mention.rb
govkit-0.7.2 lib/generators/govkit/templates/mention.rb
govkit-h-0.7.1.0 lib/generators/govkit/templates/mention.rb