Sha256: 2bb2fba4d7d621f80390d25efb5ff329f4c6865a92c0ad35d308fa4dfe123b64

Contents?: true

Size: 699 Bytes

Versions: 16

Compression:

Stored size: 699 Bytes

Contents

=begin rdoc
Author::    Chris Hauboldt (mailto:biz@lnstar.com)
Copyright:: 2009 Lone Star Internet Inc.

Used to store key-value pairs for a NewsletterPiece's NewsletterFields

=end

module Newsletter
  class FieldValue < ActiveRecord::Base
    self.table_name =  "#{::Newsletter.table_prefix}field_values"
    belongs_to :piece, :class_name => 'Newsletter::Piece'
    belongs_to :field, :class_name => 'Newsletter::Field'
    scope :by_piece, lambda{|piece| where("piece_id IS NOT NULL AND piece_id=?",piece.try(:id))}
    scope :by_field, lambda{|field| where("field_id IS NOT NULL AND field_id=?",field.try(:id))}
    scope :by_key, lambda{|key| where(key: key)}

    attr_protected :id
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
newsletter-3.2.25.1 app/models/newsletter/field_value.rb
newsletter-3.2.22.0 app/models/newsletter/field_value.rb
newsletter-3.2.7 app/models/newsletter/field_value.rb
newsletter-3.2.6 app/models/newsletter/field_value.rb
newsletter-3.2.5 app/models/newsletter/field_value.rb
newsletter-3.2.4 app/models/newsletter/field_value.rb
newsletter-3.2.2 app/models/newsletter/field_value.rb
newsletter-3.2.1 app/models/newsletter/field_value.rb
newsletter-3.2.0 app/models/newsletter/field_value.rb
newsletter-3.0.2 app/models/newsletter/field_value.rb
newsletter-3.0.1 app/models/newsletter/field_value.rb
newsletter-3.0.0 app/models/newsletter/field_value.rb
newsletter-0.1.2 app/models/newsletter/field_value.rb
newsletter-0.1.1 app/models/newsletter/field_value.rb
newsletter-0.1.0 app/models/newsletter/field_value.rb
newsletter-0.0.1 app/models/newsletter/field_value.rb