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.
171 172 173 174 |
# File 'lib/activerecord_instance_methods.rb', line 171 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.
165 166 167 168 |
# File 'lib/activerecord_instance_methods.rb', line 165 def is_draft? raise DraftPunk::ApprovedVersionIdError unless respond_to?("approved_version_id") approved_version_id.present? end |