Module: HasModerated::ModeratedCreate::ClassMethods

Defined in:
lib/has_moderated/moderated_create.rb

Instance Method Summary collapse

Instance Method Details

#has_moderated_create(*options) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/has_moderated/moderated_create.rb', line 4

def has_moderated_create *options
  HasModerated::Common::init(self)
  # Lazily include the instance methods so we don't clutter up
  # any more ActiveRecord models than we have to.
  send :include, InstanceMethods

  # save options for use later
  cattr_accessor :moderated_create_options
  self.moderated_create_options = (options.count > 0) ? options[0] : {}

  alias_method_chain :create_or_update, :moderation
end