⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 just_published.rb

📁 用ruby on rails写的一个博客程序,还不错..ruby on rails的确是个好框架
💻 RB
字号:
module ContentState  class JustPublished < Published    include Singleton    # We need to save the state as 'Published', but we need after_save    # to be handled by JustPublished. So, JustPublished tells Rails that    # it's *actually* Published and all shall be well.    def memento      'ContentState::Published'    end    def just_published?      true    end    def just_changed_published_status?      true    end    def published?(content)      true    end#    def enter_hook(content)#      super#    end#    def set_published_at(content, new_time)#      super#    end    def send_notifications(content)      content.interested_users.each do |user|        content.send_notification_to_user(user)      end    end    def send_pings(content)      content.really_send_pings    end    def withdraw(content)      content[:published_at] = nil      content.state = Factory.new(:draft)    end  endend

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -