Module: Opinio::OpinioSubjectum::ClassMethods

Defined in:
lib/opinio/opinio_subjectum.rb

Instance Method Summary collapse

Instance Method Details

#opinio_subjectum(*args) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/opinio/opinio_subjectum.rb', line 9

def opinio_subjectum(*args)
  options = args.extract_options!
  options.delete(:as)

  default_options = { :class_name => Opinio.model_name,
                      :as => :commentable,
                      :order => "created_at #{Opinio.sort_order}",
                      :dependent => :destroy }

  has_many :comments, default_options.merge(options)

end