Module: Commentable

Included in:
AbstractResult, AdvanceDirective, Allergy, Condition, Encounter, Immunization, InsuranceProvider, Medication, Provider
Defined in:
lib/commentable.rb

Defined Under Namespace

Modules: CommentableInstance

Class Method Summary (collapse)

Class Method Details

+ (Object) included(base)



3
4
5
6
7
8
9
10
# File 'lib/commentable.rb', line 3

def self.included(base)
  base.class_eval do
    has_one :comment, :as => :commentable, :dependent => :destroy
    accepts_nested_attributes_for :comment, :allow_destroy => true,
      :reject_if => proc { |attrs| attrs['text'].blank? }
    include CommentableInstance
  end
end