Changeset 1665

Show
Ignore:
Timestamp:
02/27/08 00:10:12 (3 months ago)
Author:
pdcawley
Message:

Blog object is becoming a singleton. Expect to see multiblogging implemented as a plugin if someone has a sufficiently pressing need.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/app/apis/blogger_service.rb

    r1242 r1665  
    4444 
    4545  def deletePost(appkey, postid, username, password, publish) 
    46     article = this_blog.articles.find(postid) 
    47     article.destroy 
     46    Article.destroy(postid) 
    4847    true 
    4948  end 
     
    7170    title, categories, body = content.match(%r{^<title>(.+?)</title>(?:<category>(.+?)</category>)?(.+)$}mi).captures rescue nil 
    7271 
    73     article = this_blog.articles.build 
     72    article = Article.new 
    7473    article.body           = body || content || '' 
    7574    article.title          = title || content.split.slice(0..5).join(' ') || '' 
  • trunk/app/apis/meta_weblog_service.rb

    r1494 r1665  
    7373 
    7474  def getPost(postid, username, password) 
    75     article = this_blog.articles.find(postid) 
     75    article = Article.find(postid) 
    7676 
    7777    article_dto_from(article) 
     
    7979 
    8080  def getRecentPosts(blogid, username, password, numberOfPosts) 
    81     this_blog.articles.find(:all, :order => "created_at DESC", :limit => numberOfPosts).collect{ |c| article_dto_from(c) } 
     81    Article.find(:all, :order => "created_at DESC", :limit => numberOfPosts).collect{ |c| article_dto_from(c) } 
    8282  end 
    8383 
    8484  def newPost(blogid, username, password, struct, publish) 
    85     article = this_blog.articles.build 
     85    article = Article.new 
    8686    article.body        = struct['description'] || '' 
    8787    article.title       = struct['title'] || '' 
     
    113113 
    114114  def deletePost(appkey, postid, username, password, publish) 
    115     article = this_blog.articles.find(postid) 
    116     article.destroy 
     115    Article.destroy(postid) 
    117116    true 
    118117  end 
    119118 
    120119  def editPost(postid, username, password, struct, publish) 
    121     article = this_blog.articles.find(postid) 
     120    article = Article.find(postid) 
    122121    article.body        = struct['description'] || '' 
    123122    article.title       = struct['title'] || '' 
  • trunk/app/apis/movable_type_service.rb

    r1514 r1665  
    7474 
    7575  def getRecentPostTitles(blogid, username, password, numberOfPosts) 
    76     this_blog.articles.find(:all,:order => "created_at DESC", :limit => numberOfPosts).collect do |article| 
     76    Article.find(:all,:order => "created_at DESC", :limit => numberOfPosts).collect do |article| 
    7777      MovableTypeStructs::ArticleTitle.new( 
    7878            :dateCreated => article.created_at, 
     
    9494 
    9595  def getPostCategories(postid, username, password) 
    96     this_blog.articles.find(postid).categorizations.collect do |c| 
     96    Article.find(postid).categorizations.collect do |c| 
    9797      MovableTypeStructs::CategoryPerPost.new( 
    9898          :categoryName => c.category.name, 
     
    104104 
    105105  def setPostCategories(postid, username, password, categories) 
    106     article = this_blog.articles.find(postid) 
     106    article = Article.find(postid) 
    107107    article.categories.clear if categories != nil 
    108108 
     
    127127 
    128128  def getTrackbackPings(postid) 
    129     article = this_blog.articles.find(postid) 
     129    article = Article.find(postid) 
    130130    article.trackbacks.collect do |t| 
    131131      MovableTypeStructs::TrackBack.new( 
     
    138138 
    139139  def publishPost(postid, username, password) 
    140     article = this_blog.articles.find(postid) 
     140    article = Article.find(postid) 
    141141    article.published = true 
    142142    article.save 
  • trunk/app/controllers/admin/base_controller.rb

    r1636 r1665  
     1module Admin 
     2end 
    13class Admin::BaseController < ApplicationController 
    24  cattr_accessor :look_for_migrations 
     
    2022    end 
    2123  end 
    22    
     24 
    2325  def look_for_needed_db_updates 
    2426    if Migrator.offer_migration_when_available 
  • trunk/app/controllers/admin/content_controller.rb

    r1631 r1665  
    11require 'base64' 
    2  
     2module Admin; end 
    33class Admin::ContentController < Admin::BaseController 
    44  def index 
     
    1919 
    2020    now = Time.now 
    21     count = this_blog.articles.size 
     21    count = Article.count 
    2222    @articles_pages = Paginator.new(self, count, 15, params[:id]) 
    23     @articles = this_blog.articles.find(:all, :limit => 15, :order => order, 
    24                                         :offset => @articles_pages.current.offset) 
     23    @articles = Article.find(:all, :limit => 15, :order => order, 
     24                             :offset => @articles_pages.current.offset) 
    2525    setup_categories 
    26     @article = this_blog.articles.build(params[:article]) 
     26    @article = Article.new(params[:article]) 
    2727  end 
    2828 
    2929  def show 
    30     @article = this_blog.articles.find(params[:id]) 
     30    @article = Article.find(params[:id]) 
    3131    setup_categories 
    3232    @resources = Resource.find(:all, :order => 'created_at DESC') 
     
    3737 
    3838  def destroy 
    39     @article = this_blog.articles.find(params[:id]) 
     39    @article = Article.find(params[:id]) 
    4040    if request.post? 
    4141      @article.destroy 
     
    4949 
    5050  def category_remove 
    51     @article  = this_blog.articles.find(params[:id]) 
     51    @article  = Article.find(params[:id]) 
    5252    @category = @article.categories.find(params['category_id']) 
    5353    setup_categories 
     
    5959  def preview 
    6060    headers["Content-Type"] = "text/html; charset=utf-8" 
    61     @article = this_blog.articles.build 
     61    @article = Article.new 
    6262    @article.attributes = params[:article] 
    6363    set_article_author 
     
    9494  def do_add_or_remove_fu 
    9595    attrib, action = params[:action].split('_') 
    96     @article = this_blog.articles.find(params[:id]) 
     96    @article = Article.find(params[:id]) 
    9797    self.send("#{attrib}=", self.class.const_get(attrib.classify).find(params["#{attrib}_id"])) 
    9898    send("setup_#{attrib.pluralize}") 
     
    169169    @article = case params[:action] 
    170170               when 'new' 
    171                  returning(this_blog.articles.build) do |art| 
     171                 returning(Article.new) do |art| 
    172172                   art.allow_comments = this_blog.default_allow_comments 
    173173                   art.allow_pings    = this_blog.default_allow_pings 
     
    175175                 end 
    176176               when 'edit' 
    177                  this_blog.articles.find(params[:id]) 
     177                 Article.find(params[:id]) 
    178178               else 
    179179                 raise "Don't know how to get article for action: #{params[:action]}" 
  • trunk/app/controllers/admin/feedback_controller.rb

    r1587 r1665  
    55 
    66  def index 
    7     conditions = ['blog_id = :blog_id', {:blog_id => Blog.default.id}] 
     7    conditions = ['1 = 1', {}] 
    88 
    99    if params[:search] 
  • trunk/app/controllers/articles_controller.rb

    r1637 r1665  
    2020 
    2121  def index 
    22     @articles = this_blog.requested_articles(params
     22    @articles = Article.find_all_by_date(*params.values_at(:year, :month, :day)
    2323 
    2424    @page_title = index_title 
     
    5858 
    5959  def archives 
    60     @articles = this_blog.published_articles 
     60    @articles = Article.find_published(:order => 'published_at DESC') 
    6161    @page_title = "Archives" 
    6262  end 
  • trunk/app/controllers/comments_controller.rb

    r1645 r1665  
    3535    @comments = \ 
    3636      if params[:article_id] 
    37         this_blog.requested_article(params).published_comments 
     37        Article.find_by_params_hash(params).published_comments 
    3838      else 
    39         this_blog.published_comments.find(:all, this_blog.rss_limit_params.merge(:order => 'created_at DESC')) 
     39        Comment.find_published(:all, this_blog.rss_limit_params.merge(:order => 'created_at DESC')) 
    4040      end 
    4141  end 
  • trunk/app/controllers/xml_controller.rb

    r1560 r1665  
    8787  def fetch_items(association, order='published_at DESC', limit=nil) 
    8888    if association.instance_of?(Symbol) 
    89       association = this_blog.send(association) 
     89      association = association.to_s.singularize.classify.constantize 
    9090    end 
    9191    limit ||= this_blog.limit_rss_display 
  • trunk/app/helpers/application_helper.rb

    r1661 r1665  
    198198  <link rel="alternate" type="application/atom+xml" title="Atom" href="#{ @auto_discovery_url_atom }" /> 
    199199  <link rel="alternate" type="application/rss+xml" title="RSS" href="#{ @auto_discovery_url_rss }" /> 
    200   #{ javascript_include_tag "lang/" + Localization.lang
     200  #{ javascript_include_tag "lang/" + Localization.lang.to_s
    201201  #{ javascript_include_tag "cookies" } 
    202202  #{ javascript_include_tag "prototype" } 
  • trunk/app/helpers/sidebar_helper.rb

    r1407 r1665  
    11module SidebarHelper 
    22  def render_sidebars(*sidebars) 
    3     (sidebars.blank? ? this_blog.sidebars : sidebars).inject('') do |acc, sb| 
     3    (sidebars.blank? ? Sidebar.find(:all) : sidebars).inject('') do |acc, sb| 
    44      @sidebar = sb 
    55      sb.parse_request(contents, params) 
  • trunk/app/models/article.rb

    r1638 r1665  
    4444 
    4545  include States 
     46 
     47  class << self 
     48    def published_articles 
     49      find(:conditions => { :published => true }, :order => 'published_at DESC') 
     50    end 
     51 
     52    def count_published_articles 
     53      count(:conditions => { :published => true }) 
     54    end 
     55  end 
    4656 
    4757  def stripped_title 
  • trunk/app/models/blog.rb

    r1654 r1665  
    1919  include ConfigManager 
    2020 
    21   has_many :contents 
    22   has_many :trackbacks 
    23   has_many :articles 
    24   has_many :comments 
    25   has_many(:published_comments, 
    26            :class_name => 'Comment', 
    27            :conditions => {:published => true}, 
    28            :order      => 'feedback.published_at DESC') 
    29   has_many(:published_trackbacks, 
    30            :class_name => 'Trackback', 
    31            :conditions => {:published => true}, 
    32            :order      => 'feedback.published_at DESC') 
    33   has_many(:published_feedback, 
    34            :class_name => 'Feedback', 
    35            :conditions => {:published => true}, 
    36            :order      => 'feedback.published_at DESC') 
    37   has_many(:pages, 
    38            :order      => "id DESC") 
    39   has_many(:published_articles, 
    40            :class_name => "Article", 
    41            :conditions => {:published => true}, 
    42            :include    => [:categories, :tags], 
    43            :order      => "contents.published_at DESC") do 
    44     def before(date = Time.now) 
    45       find(:all, :conditions => ["contents.created_at < ?", date]) 
    46     end 
    47   end 
    48  
    49   has_many :pages 
    50   has_many :sidebars, :order => 'active_position ASC' 
     21  validate_on_create { |blog| 
     22    unless Blog.count.zero? 
     23      blog.errors.add_to_base("There can only be one...") 
     24    end 
     25  } 
    5126 
    5227  serialize :settings, Hash 
     
    11792  # Blog.  The last case should only be used when Typo is first installed. 
    11893  def self.find_blog(base_url) 
    119     (Blog.find_by_base_url(base_url) rescue nil)|| Blog.default || Blog.new 
     94    Blog.default || Blog.create 
    12095  end 
    12196 
  • trunk/app/models/content.rb

    r1638 r1665  
    66 
    77  belongs_to :text_filter 
    8   belongs_to :blog 
    9   validates_presence_of :blog_id 
    108 
    119  has_many :notifications, :foreign_key => 'content_id' 
     
    3735  @@html_map       = Hash.new 
    3836 
    39   def initialize(*args) 
    40     if block_given? 
    41       super(*args) { |instance| yield(instance) } 
    42     else 
    43       super(*args) 
    44     end 
    45     set_default_blog 
    46   end 
    47  
    4837  def invalidates_cache?(on_destruction = false) 
    4938    if on_destruction 
     
    5140    else 
    5241      changed? && published? || just_changed_published_status? 
    53     end 
    54   end 
    55  
    56   def set_default_blog 
    57     if self.blog_id.nil? || self.blog_id == 0 
    58       self.blog = Blog.default 
    5942    end 
    6043  end 
     
    170153 
    171154  # Grab the text filter for this object.  It's either the filter specified by 
    172   # self.text_filter_id, or the default specified in the blog object. 
     155  # self.text_filter_id, or the default specified in the default blog object. 
    173156  def text_filter 
    174157    if self[:text_filter_id] && !self[:text_filter_id].zero? 
     
    199182  end 
    200183 
    201   # FIXME -- this feels wrong. 
    202184  def blog 
    203     self[:blog] ||= blog_id.to_i.zero? ? Blog.default : Blog.find(blog_id) 
     185    Blog.default 
    204186  end 
    205187 
  • trunk/app/models/sidebar.rb

    r1637 r1665  
    11class Sidebar < ActiveRecord::Base 
    22  serialize :config 
    3   belongs_to :blog 
    43 
    54  class Field 
     
    189188  end 
    190189 
     190  def blog 
     191    Blog.default 
     192  end 
     193 
    191194  def initialize(*args) 
    192195    if block_given? 
  • trunk/spec/controllers/admin/content_controller_spec.rb

    r1623 r1665  
    66 
    77# Re-raise errors caught by the controller. 
     8module Admin 
     9end 
     10 
    811class Admin::ContentController; def rescue_action(e) raise e end; end 
    912 
     
    6568    ActionMailer::Base.perform_deliveries = true 
    6669    ActionMailer::Base.deliveries = [] 
    67     num_articles = this_blog.published_articles.size 
     70    num_articles = Article.count_published_articles 
    6871    emails = ActionMailer::Base.deliveries 
    6972    tags = ['foo', 'bar', 'baz bliz', 'gorp gack gar'] 
     
    7174    assert_response :redirect, :action => 'show' 
    7275 
    73     assert_equal num_articles + 1, this_blog.published_articles.size 
     76    assert_equal num_articles + 1, Article.count_published_articles 
    7477 
    7578    new_article = Article.find(:first, :order => "id DESC") 
     
    8689 
    8790  def test_create_future_article 
    88     num_articles = this_blog.published_articles.size 
     91    num_articles = Article.count_published_articles 
    8992    post(:new, 
    9093         :article => { :title => "News from the future!", 
     
    9396    assert_response :redirect, :action => 'show' 
    9497    assert ! assigns(:article).published? 
    95     assert_equal num_articles, this_blog.published_articles.size 
     98    assert_equal num_articles, Article.count_published_articles 
    9699    assert_equal 1, Trigger.count 
    97100  end 
    98101 
    99102  def test_request_fires_triggers 
    100     art = this_blog.articles.create!(:title => 'future article', 
    101                                      :body => 'content', 
    102                                      :published_at => Time.now + 2.seconds, 
    103                                      :published => true) 
     103    art = Article.create!(:title => 'future article', 
     104                          :body => 'content', 
     105                          :published_at => Time.now + 2.seconds, 
     106                          :published => true) 
    104107    assert !art.published? 
    105108    sleep 3 
  • trunk/spec/controllers/admin/feedback_controller_spec.rb

    r1623 r1665  
    2323    assert_template 'list' 
    2424 
    25     assert_equal(Feedback.count(:conditions => ['blog_id = ? AND status_confirmed = ?', 
    26                                                 blogs(:default).id,               false]), 
    27                  assigns(:feedback).size) 
    28  
     25    Feedback.count(:conditions => { :status_confirmed => false }).should == assigns(:feedback).size 
    2926  end 
    3027 
     
    3532    assert_template 'list' 
    3633 
    37     assert_equal(Feedback.count(:conditions => ['blog_id = ? AND published = ?', 
    38                                                 blogs(:default).id,        false]), 
    39                  assigns(:feedback).size) 
     34    Feedback.count(:conditions => { :published => false }).should == assigns(:feedback).size 
    4035  end 
    4136 
     
    4641    assert_template 'list' 
    4742 
    48     assert_equal(Feedback.count(:conditions => ['blog_id = ? AND published = ? AND status_confirmed = ?', 
    49                                                 blogs(:default).id,        false,                   false]), 
    50                  assigns(:feedback).size) 
     43    Feedback.count(:conditions => { :published => false, :status_confirmed => false }).should == assigns(:feedback).size 
    5144  end 
    52  
    5345end 
  • trunk/spec/controllers/articles_controller_spec.rb

    r1622 r1665  
    4141  before do 
    4242    @mock = mock('everything', :null_object => true) 
    43     Blog.stub!(:find).and_return(@mock) 
    4443    Category.stub!(:find_by_permalink).and_return(@mock) 
    4544    Tag.stub!(:find_by_permalink).and_return(@mock) 
  • trunk/spec/controllers/backend_controller_spec.rb

    r1623 r1665  
    5151    assert_equal "textile", new_post.text_filter.name 
    5252    assert_equal users(:tobi), new_post.user 
    53     assert_equal this_blog.id, new_post.blog_id 
    5453    assert new_post.published? 
    5554    assert new_post[:published_at] 
     
    7675    assert_equal "new post body", new_post.body 
    7776    assert_equal [categories(:software), categories(:hardware)], new_post.categories.sort_by { |c| c.id } 
    78     assert_equal this_blog.id, new_post.blog_id 
    7977    assert new_post.published? 
    8078  end 
     
    8785    new_post = Article.find(result) 
    8886    assert_equal [categories(:hardware)], new_post.categories 
    89     assert_equal this_blog.id, new_post.blog_id 
    9087  end 
    9188 
     
    146143    assert_equal "<p>this is a <strong>test</strong></p>", new_article.html(:body) 
    147144    assert_equal Time.now.midnight.utc, new_article.published_at.utc 
    148     assert_equal this_blog.id, new_article.blog_id 
    149   end 
    150  
    151   # TODO: reduce amount of mocking needed? 
     145  end 
     146 
     147  # TODO: Work out what the correct response is when a post can't be saved... 
    152148  def test_meta_weblog_new_post_fails 
    153     stub_args = [:id_stub, :username_stub, :password_stub, {}, :publish_stub] 
    154     @controller = MetaWeblogService.new(:controller_stub) 
    155     @article = Article.new 
     149    @article = Article.new(:title => 'test', :body => 'body', :extended => 'extended', 
     150                           :text_filter => TextFilter.find_by_name('textile'), 
     151                           :published_at => Time.now.utc.midnight) 
     152    @article.errors.add_to_base('test error') 
    156153    @article.should_receive(:save).and_return(false) 
    157     @this_blog = mock('blog', :null_object => true) 
    158     articles = mock('articles') 
    159     articles.stub!(:build).and_return(@article) 
    160     @this_blog.stub!(:articles).and_return(articles) 
    161     @controller.stub!(:this_blog).and_return(@this_blog) 
    162     assert_raises(RuntimeError) { @controller.newPost(*stub_args) } 
     154    Article.stub!(:new).and_return(@article) 
     155    args = [1, 'tobi', 'whatever', MetaWeblogService.new(@controller).article_dto_from(@article), 1] 
     156    lambda { invoke_layered :metaWeblog , :newPost, *args }.should \ 
     157      raise_error(XMLRPC::FaultException, 
     158                  'Internal server error (exception raised)') 
    163159  end 
    164160 
     
    184180    assert_equal "<p>extend me</p>", new_post.html(:extended) 
    185181    assert_equal Time.now.midnight.utc, new_post.published_at.utc 
    186     assert_equal this_blog.id, new_post.blog_id 
    187182  end 
    188183 
     
    290285    assert_raise(XMLRPC::FaultException) { invoke_layered :mt, :getRecentPostTitles, *args } 
    291286  end 
    292  
    293287end 
  • trunk/spec/models/article_closing_spec.rb

    r1623 r1665  
    33describe "CommentClosing from Test::Unit; no I don't know why it's in article_closing_spec.rb" do 
    44  def an_article(options = {}) 
    5     @blog.articles.create(options.reverse_merge(:user_id => 1, :body => 'Foo', :title => 'Bar')) 
     5    Article.create(options.reverse_merge(:user_id => 1, :body => 'Foo', :title => 'Bar')) 
    66  end 
    77 
  • trunk/spec/models/article_spec.rb

    r1508 r1665  
    44  before(:each) do 
    55    @a = Article.new(:title => 'Test article', :body => 'body', 
    6                      :author => mock_model(User), :blog => mock_model(Blog)
     6                     :author => mock_model(User)
    77  end 
    88 
  • trunk/spec/models/blog_spec.rb

    r1622 r1665  
    2121  end 
    2222 
    23   it "blog has one sidebar" do 
    24     @blog.should have(1).sidebars 
     23  it "should be the only blog allowed" do 
     24    Blog.new.should_not be_valid 
    2525  end 
    2626end 
     27 
     28describe "Given no blogs" do 
     29  before(:each)  { Blog.destroy_all } 
     30 
     31  it "should allow the creation of a valid default blog" do 
     32    Blog.new.should be_valid 
     33  end 
     34end 
  • trunk/spec/models/comment_spec.rb

    r1655 r1665  
    148148 
    149149  def test_published 
    150     a = Article.new(:title => 'foo', :blog_id => blogs(:default).id
     150    a = Article.new(:title => 'foo'
    151151    assert a.save 
    152152 
     
    161161    c.withdraw! 
    162162 
    163     a = Article.new(:title => 'foo', :blog_id => 1
     163    a = Article.new(:title => 'foo'
    164164    assert_equal 0, a.published_comments.size 
    165165  end 
  • trunk/spec/models/page_spec.rb

    r1622 r1665  
    8686 
    8787  it 'default filter should be fetched from the blog' do 
    88     blog = mock_model(Blog) 
    89     Blog.stub!(:find).and_return(blog) 
    90     textfilter = mock_model(TextFilter) 
    91     textfilter.stub!(:to_text_filter).and_return(textfilter) 
    92  
    93     blog.should_receive(:text_filter).and_return(textfilter) 
    94     @page = Page.new(valid_attributes.merge(:blog => blog)) 
    95     @page.default_text_filter.should == textfilter 
     88    @page = Page.new() 
     89    @page.default_text_filter.name.should == Blog.default.text_filter 
    9690  end 
    9791end 
  • trunk/spec/models/ping_spec.rb

    r1622 r1665  
    3838 
    3939 
    40     a = blog.articles.build
     40    a = Article.new
    4141      :body => '<a href="http://anotherblog.org/a-post">', 
    4242      :title => 'Test the pinging', 
  • trunk/test/fixtures/contents.yml

    r1621 r1665  
    22 
    33article1: 
    4   blog: default 
    54  title: Article 1! 
    65  body: body 
     
    2221article2: 
    2322  type: Article 
    24   blog: default 
    2523  title: Article 2! 
    2624  body: body 
     
    4240article3: 
    4341  type: Article 
    44   blog: default 
    4542  title: Article 3! 
    4643  body: body 
     
    6057article4: 
    6158  type: Article 
    62   blog: default 
    6359  title: Article 4! 
    6460  body: I'm not "public":http://www.example.com/public! 
     
    7874first_page: 
    7975  type: Page 
    80   blog: default 
    8176  name: page_one 
    8277  title: Page One Title 
     
    9186another_page: 
    9287  type: Page 
    93   blog: default 
    9488  name: page/two 
    9589  title: Another Page Title 
     
    10498markdown_page: 
    10599  type: Page 
    106   blog: default 
    107100  name: markdown-page 
    108101  title: Markdown Page 
     
    118111inactive_article: 
    119112  type: Article 
    120   blog: default 
    121113  title: Inactive Article 
    122114  body: body 
     
    136128search_target: 
    137129  type: Article 
    138   blog: default 
    139130  title: Find me! 
    140131  body: search target 
     
    154145xmltest: 
    155146  type: Article 
    156   blog: default 
    157147  title: Associations aren't :dependent => true anymore 
    158148  body: originally seen on <a href="http://blog.rubyonrails.org/">blog.rubyonrails.org</a> 
     
    172162spammed_article: 
    173163  type: Article 
    174   blog: default 
    175164  title: C'mon Spam Me! 
    176165  body: A bunch of innocuous content 
  • trunk/test/fixtures/feedback.yml

    r1621 r1665  
    11spam_comment: 
    22  type: Comment 
    3   blog: default 
    43  published: true 
    54  article: article2 
     
    1514comment2: 
    1615  type: Comment 
    17   blog: default 
    1816  published: true 
    1917  article: article1 
     
    3129comment3: 
    3230  type: Comment 
    33   blog: default 
    3431  published: false 
    3532  state: presumed_spam 
     
    4542trackback1: 
    4643  type: Trackback 
    47   blog: default 
    4844  article: article2 
    4945  published: false 
     
    6157trackback2: 
    6258  type: Trackback 
    63   blog: default 
    6459  article: article1 
    6560  state: presumed_ham 
     
    7671trackback3: 
    7772  type: Trackback 
    78   blog: default 
    7973  article: article1 
    8074  published: true 
     
    9185trackback4: 
    9286  type: Trackback 
    93   blog: default 
    9487  article: search_target 
    9588  published: true 
     
    10699old_comment: 
    107100  type: Comment 
    108   blog: default 
    109101  article: inactive_article 
    110102  author: John Bar 
     
    121113probably_spam_comment: 
    122114  type: Comment 
    123   blog: default 
    124115  published: false 
    125116  article: spammed_article 
     
    136127definitely_spam_comment: 
    137128  type: Comment 
    138   blog: default 
    139129  published: false 
    140130  article: spammed_article 
  • trunk/test/fixtures/sidebars.yml

    r1621 r1665  
    33  active_position: 1 
    44  staged_position: 1 
    5   blog: default 
    65  config: |+ 
    76    --- !map:HashWithIndifferentAccess