Module: Drafter::Draftable::ClassMethods

Defined in:
lib/drafter/draftable.rb

Overview

Overrides the draftable method to define the draftable? class method.

Instance Method Summary collapse

Instance Method Details

#draftable(options = {}) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/drafter/draftable.rb', line 8

def draftable(options={})
  super(options)

  cattr_accessor :polymorphic_as
  self.polymorphic_as = options[:polymorphic_as]

  cattr_accessor :delegate_approval_to
  self.delegate_approval_to = options[:delegate_approval_to]

  class << self
    def draftable?
      true
    end
  end
end

#draftable?Boolean

For all ActiveRecord::Base models that do not call the draftable method, the draftable? method will return false.

Returns:

  • (Boolean)


26
27
28
# File 'lib/drafter/draftable.rb', line 26

def draftable?
  false
end