Multiblog feature #278

wants to merge 35 commits into


None yet
3 participants

rochgs commented Aug 30, 2012

I have added the multiblog feature. Basically I have created a Blog model and associated posts and categories to it (comments are associated through posts). Then changed the routes so the ones from the other models are nested to the blog ones.

About pages, the model blog creates an associated page for each new blog. This new page has the "Blogs" page as parent if it exists (if no they are created as root pages). The idea is the users hide the "Blogs" page if they don't want a blog index. When the user changed the name of the blog, its associated page title and link_url are updated too.

The general settings about the blog (comments moderations, comments enabled, etc) now are managed through the Blog model. They use "blog-{}" as the settings scope, being "self" the blog which settings are being changed.

Blogs are internationalized.

We need this features for a project of our company, so we are going to continue working on it. Specially bug fixing but we think is a cool feature you may be interested in add to the official gem, so we pull request it.

Any comment, you are welcome :)

This pull request fails (merged 3d40293 into 50661cc).

This pull request passes (merged fc6f75a into 50661cc).


parndt commented Aug 31, 2012

This will require a massive amount of reviewing but right away I
noticed can you make sure you use two spaces for indentation? It
appears wildly different in many places. Thanks :)

before_filter :find_all_categories,
- :only => [:new, :edit, :create, :update]
+ :only => [:new, :edit, :update]

parndt Aug 31, 2012


Please can you indent like we had? This is very hard to read.

- )
+ 'refinery.crudify.created',
+ :what => "'#{@post.title}'"
+ )

parndt Aug 31, 2012


Why was indentation changed here?


parndt commented Aug 31, 2012

I have left line note examples of the first couple indentation issues.
I don't want to overload you with email so I haven't put any more but
hopefully you can extrapolate my point. I like to keep lines short and
excess indentation blows them out and makes it impossible to read
without scrolling left and right a lot.

Thanks :)


parndt commented Aug 31, 2012

I am not sure I like methods like

Couldn't everything be scoped further up? Like:


Sorry if unclear

rochgs commented Aug 31, 2012

  • About indentation: ok, I understand your concerns about indentation. It's the default Emacs Rinari-mode indentation. I will see what I can do about it.
  • About methods: it's perfectly clear. I didn't like they either but I didn't have much time so didn't think it twice. Still it should easy to fix it with facade methods in the Blog model.

I am going to try to fix these issues while I am integrating the engine in our app but I can't promise to give them dedicated time. Sorry for the inconveniences.

rochgs added some commits Aug 17, 2012

Linking the posts lists from the edit button in the blogs
list. Changed the posts controller so it now expects a blog id.
- Beginning refactorization in routes of posts, comments and
  categories as nested models of blog.

- Changed submenu partial so it now expects the blog to be passed as a
  local param.

- Fixed errata in tests.
- Refactoring posts as a nested model of blog (only admin
  functions). Updated tests.

- Refactoring blog title html to a partial.
- Changed plugin activity information to include blogs updates.
- Changed tab name (from "blog" to "blogs") in english.
- Updated posts_helper tests.
- Changed search methods in Post so they take blog into account.
- Added a blogs index.
- Changed seed.rb. It now creates the page for blog with plurarls
  ('blogs' besides 'blog').
- Added code responsable of saving for all the locales the slug of the
  blogs page in the seeds file.

- Changed indentation (for a more conventional one).
Fixing category load when creating a new posts fails
validations. Added tests for this case.

@parndt parndt closed this Nov 22, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment