<commit_before>module  Crowdblog
  class Post < ActiveRecord::Base
    belongs_to :author, class_name: 'User'
    belongs_to :publisher, class_name: 'User'
    has_many :assets

    delegate :name, to: :author, prefix: true
    delegate :email, to: :author, prefix: true
    delegate :gravatar_url, to: :author

    delegate :year, to: :published_at

    attr_accessor :transition
    attr_accessible :title, :body, :updated_by, :ready_for_review, :transition

    LEGACY_TITLE_REGEXP = /(\d+-\d+-\d+)-(.*)/

    state_machine initial: :drafted do
      state :drafted
      state :published

      before_transition on: :publish do |post, transition|
        #post.update_attribute(:published_at, Time.now)
        post.published_at ||= Time.now
      end<commit_msg>Post author and publisher should be of Crowdblog::User class<commit_after>module  Crowdblog
  class Post < ActiveRecord::Base
    belongs_to :author, class_name: 'Crowdblog::User'
    belongs_to :publisher, class_name: 'Crowdblog::User'
    has_many :assets

    delegate :name, to: :author, prefix: true
    delegate :email, to: :author, prefix: true
    delegate :gravatar_url, to: :author

    delegate :year, to: :published_at

    attr_accessor :transition
    attr_accessible :title, :body, :updated_by, :ready_for_review, :transition

    LEGACY_TITLE_REGEXP = /(\d+-\d+-\d+)-(.*)/

    state_machine initial: :drafted do
      state :drafted
      state :published

      before_transition on: :publish do |post, transition|
        #post.update_attribute(:published_at, Time.now)
        post.published_at ||= Time.now
      end
{'fraction_non_alphanumeric': 0.11090342679127727, 'fraction_numerical': 0.0, 'mean_word_length': 3.54957507082153, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5973995', 'n_tokens_mistral': 525, 'n_tokens_neox': 508, 'n_words': 135}