Module: DraftPunk::Model::InstanceInterrogators
- Defined in:
- lib/activerecord_instance_methods.rb
Instance Method Summary collapse
-
#has_draft? ⇒ Boolean
Whether the current ActiveRecord object has a draft version.
-
#is_draft? ⇒ Boolean
Whether the current ActiveRecord object is a draft.
Instance Method Details
#has_draft? ⇒ Boolean
Returns whether the current ActiveRecord object has a draft version.
162 163 164 165 |
# File 'lib/activerecord_instance_methods.rb', line 162 def has_draft? raise DraftPunk::ApprovedVersionIdError unless respond_to?(:approved_version_id) draft.present? end |
#is_draft? ⇒ Boolean
Returns whether the current ActiveRecord object is a draft.
156 157 158 159 |
# File 'lib/activerecord_instance_methods.rb', line 156 def is_draft? raise DraftPunk::ApprovedVersionIdError unless respond_to?("approved_version_id") approved_version_id.present? end |