Module: AttrPublish
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/attr_publish/version.rb,
lib/attr_publish/attr_publish.rb
Defined Under Namespace
Modules: Version
Query scopes added to publishable models collapse
-
.published ⇒ Object
Query scope added to publishables that can be used to find published records.
-
.recent ⇒ Object
Query scope added to publishables that can be used to lookup records which are currently published.
-
.unpublished ⇒ Object
Query scope added to publishables that can be used find records which are not published.
-
.upcoming ⇒ Object
Query scope added to publishables that can be used to lookup records which are not currently published.
Instance methods added to publishable models collapse
-
#publish ⇒ Object
Publish this object.
-
#publish! ⇒ Object
Publish this object, then immediately save it to the database.
-
#published? ⇒ Boolean
Is this object published?.
-
#unpublish ⇒ Object
Un-publish this object, i.e.
-
#unpublish! ⇒ Object
Un-publish this object, then immediately save it to the database.
-
#unpublished? ⇒ Boolean
Is this object not published?.
Class Method Details
.published ⇒ Object
Query scope added to publishables that can be used to find published records. For Date/DateTime publishables, you can pass a specific date on which the results should be published.
|
# File 'lib/attr_publish/attr_publish.rb', line 151
|
.recent ⇒ Object
Query scope added to publishables that can be used to lookup records which are currently published. The results are returned in descending order based on the published date/time.
|
# File 'lib/attr_publish/attr_publish.rb', line 169
|
.unpublished ⇒ Object
Query scope added to publishables that can be used find records which are not published. For Date/DateTime publishables, you can pass a specific date on which the results should not have been published.
|
# File 'lib/attr_publish/attr_publish.rb', line 161
|
.upcoming ⇒ Object
Query scope added to publishables that can be used to lookup records which are not currently published. The results are returned in ascending order based on the published date/time.
|
# File 'lib/attr_publish/attr_publish.rb', line 177
|
Instance Method Details
#publish ⇒ Object
Publish this object. For a Boolean publish field, the field is set to true; for a Date/DateTime field, the field is set to the given Date/Time or to the current date/time.
|
# File 'lib/attr_publish/attr_publish.rb', line 203
|
#publish! ⇒ Object
Publish this object, then immediately save it to the database.
|
# File 'lib/attr_publish/attr_publish.rb', line 210
|
#published? ⇒ Boolean
Is this object published?
|
# File 'lib/attr_publish/attr_publish.rb', line 189
|
#unpublish ⇒ Object
Un-publish this object, i.e. set it to not be published. For a Boolean publish field, the field is set to false; for a Date/DateTime field, the field is cleared.
|
# File 'lib/attr_publish/attr_publish.rb', line 215
|
#unpublish! ⇒ Object
Un-publish this object, then immediately save it to the database.
|
# File 'lib/attr_publish/attr_publish.rb', line 220
|
#unpublished? ⇒ Boolean
Is this object not published?
|
# File 'lib/attr_publish/attr_publish.rb', line 196
|