We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 70de0e6 + 73a290c commit e011c19Copy full SHA for e011c19
app/models/alchemy/element.rb
@@ -234,9 +234,10 @@ def store_page(page)
234
def public=(value)
235
@public_on_explicitely_set = true
236
if ActiveModel::Type::Boolean.new.cast(value)
237
- self.public_on ||= Time.current
+ self.public_on = Time.current
238
+ self.public_until = nil
239
else
- self.public_on = nil
240
+ self.public_until = Time.current
241
end
242
243
spec/models/alchemy/page/publisher_spec.rb
@@ -28,7 +28,7 @@
28
shared_context "with elements" do
29
let(:page) do
30
create(:alchemy_page, autogenerate_elements: true).tap do |page|
31
- page.draft_version.elements.first.update!(public: false)
+ page.draft_version.elements.first.update!(public_until: 1.minute.ago)
32
33
34
0 commit comments