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
- #draftable(options = {}) ⇒ Object
-
#draftable? ⇒ Boolean
For all ActiveRecord::Base models that do not call the
draftable
method, thedraftable?
method will return false.
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(={}) super() cattr_accessor :polymorphic_as self.polymorphic_as = [:polymorphic_as] cattr_accessor :delegate_approval_to self.delegate_approval_to = [: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.
26 27 28 |
# File 'lib/drafter/draftable.rb', line 26 def draftable? false end |