spud_blog 0.9.3 → 0.9.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -23,10 +23,14 @@ class BlogController < ApplicationController
23
23
 
24
24
  def index
25
25
  page = 1
26
- if params[:page].blank? == false && params[:page].to_i > 1
26
+ if params[:page].blank? == false
27
27
  page = params[:page].to_i
28
- if(page.to_s != params[:page] && page > 1)
29
- redirect_to blog_path(:page => page),:status => :moved_permanently and return
28
+ if page.to_s != params[:page].to_s
29
+ if(page > 1)
30
+ redirect_to blog_path(:page => page),:status => :moved_permanently and return
31
+ else
32
+ redirect_to blog_path(:page => nil),:status => :moved_permanently and return
33
+ end
30
34
  end
31
35
  end
32
36
 
@@ -51,11 +55,23 @@ class BlogController < ApplicationController
51
55
  end
52
56
 
53
57
  def category
58
+ page = 1
59
+ if params[:page].blank? == false
60
+ page = params[:page].to_i
61
+ if page.to_s != params[:page].to_s
62
+ if(page > 1)
63
+ redirect_to blog_category_path(:page => page),:status => :moved_permanently and return
64
+ else
65
+ redirect_to blog_category_path(:page => nil),:status => :moved_permanently and return
66
+ end
67
+ end
68
+ end
69
+
54
70
  if @post_category = SpudPostCategory.find_by_url_name(params[:category_url_name])
55
71
  if Spud::Core.config.multisite_mode_enabled
56
- @posts = @post_category.posts_with_children.public_blog_posts(params[:page], Spud::Blog.config.posts_per_page).for_spud_site(current_site_id).from_archive(params[:archive_date])
72
+ @posts = @post_category.posts_with_children.public_blog_posts(page, Spud::Blog.config.posts_per_page).for_spud_site(current_site_id).from_archive(params[:archive_date])
57
73
  else
58
- @posts = @post_category.posts_with_children.public_blog_posts(params[:page], Spud::Blog.config.posts_per_page).from_archive(params[:archive_date])
74
+ @posts = @post_category.posts_with_children.public_blog_posts(page, Spud::Blog.config.posts_per_page).from_archive(params[:archive_date])
59
75
  end
60
76
  else
61
77
  redirect_to blog_path
@@ -1,5 +1,5 @@
1
1
  module Spud
2
2
  module Blog
3
- VERSION = "0.9.3"
3
+ VERSION = "0.9.4"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spud_blog
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.3
4
+ version: 0.9.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-12-20 00:00:00.000000000 Z
12
+ date: 2013-01-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -304,7 +304,6 @@ files:
304
304
  - MIT-LICENSE
305
305
  - Rakefile
306
306
  - Readme.markdown
307
- - test/dummy/log/development.log
308
307
  - test/fixtures/spud_post_sites.yml
309
308
  - test/unit/spud_post_site_test.rb
310
309
  homepage: http://github.com/davydotcom/spud_blog
@@ -321,7 +320,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
321
320
  version: '0'
322
321
  segments:
323
322
  - 0
324
- hash: 642274226547155954
323
+ hash: -4333841071858548276
325
324
  required_rubygems_version: !ruby/object:Gem::Requirement
326
325
  none: false
327
326
  requirements:
@@ -330,7 +329,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
330
329
  version: '0'
331
330
  segments:
332
331
  - 0
333
- hash: 642274226547155954
332
+ hash: -4333841071858548276
334
333
  requirements: []
335
334
  rubyforge_project:
336
335
  rubygems_version: 1.8.24
@@ -338,6 +337,5 @@ signing_key:
338
337
  specification_version: 3
339
338
  summary: Spud Blog Engine.
340
339
  test_files:
341
- - test/dummy/log/development.log
342
340
  - test/fixtures/spud_post_sites.yml
343
341
  - test/unit/spud_post_site_test.rb
@@ -1,36 +0,0 @@
1
- Mysql2::Error: Table 'spud_blog_development.spud_users' doesn't exist: SHOW FULL FIELDS FROM `spud_users`
2
- Mysql2::Error: Table 'spud_blog_development.spud_users' doesn't exist: SHOW FULL FIELDS FROM `spud_users`
3
- Mysql2::Error: Table 'spud_blog_development.spud_users' doesn't exist: SHOW FULL FIELDS FROM `spud_users`
4
-  (153.8ms) CREATE TABLE `schema_migrations` (`version` varchar(255) NOT NULL) ENGINE=InnoDB
5
-  (287.7ms) CREATE UNIQUE INDEX `unique_schema_migrations` ON `schema_migrations` (`version`)
6
-  (0.2ms) SELECT `schema_migrations`.`version` FROM `schema_migrations` 
7
- Migrating to CreateSpudPosts (20120125180945)
8
-  (163.8ms) CREATE TABLE `spud_posts` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `spud_user_id` int(11), `title` varchar(255), `content` text, `comments_enabled` tinyint(1) DEFAULT 0, `visible` tinyint(1) DEFAULT 1, `published_at` datetime, `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL) ENGINE=InnoDB
9
-  (225.6ms) CREATE INDEX `index_spud_posts_on_spud_user_id` ON `spud_posts` (`spud_user_id`)
10
-  (178.6ms) CREATE INDEX `index_spud_posts_on_visible` ON `spud_posts` (`visible`)
11
-  (0.5ms) INSERT INTO `schema_migrations` (`version`) VALUES ('20120125180945')
12
- Migrating to CreateSpudPostCategories (20120125181022)
13
-  (214.2ms) CREATE TABLE `spud_post_categories` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `name` varchar(255), `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL) ENGINE=InnoDB
14
-  (209.6ms) CREATE TABLE `spud_post_categories_posts` (`spud_post_id` int(11), `spud_post_category_id` int(11)) ENGINE=InnoDB
15
-  (182.2ms) CREATE INDEX `index_spud_post_categories_posts_on_spud_post_category_id` ON `spud_post_categories_posts` (`spud_post_category_id`)
16
-  (0.6ms) INSERT INTO `schema_migrations` (`version`) VALUES ('20120125181022')
17
- Migrating to CreateSpudPostComments (20120125181359)
18
-  (171.4ms) CREATE TABLE `spud_post_comments` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `spud_post_id` int(11), `author` varchar(255), `content` text, `approved` tinyint(1) DEFAULT 0, `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL) ENGINE=InnoDB
19
-  (237.9ms) CREATE INDEX `index_spud_post_comments_on_spud_post_id` ON `spud_post_comments` (`spud_post_id`)
20
-  (227.0ms) CREATE INDEX `index_spud_post_comments_on_approved` ON `spud_post_comments` (`approved`)
21
-  (0.5ms) INSERT INTO `schema_migrations` (`version`) VALUES ('20120125181359')
22
- Migrating to AddUrlToSpudPosts (20120127143054)
23
-  (239.3ms) ALTER TABLE `spud_posts` ADD `url_name` varchar(255)
24
-  (234.5ms) CREATE INDEX `index_spud_posts_on_url_name` ON `spud_posts` (`url_name`)
25
-  (0.6ms) INSERT INTO `schema_migrations` (`version`) VALUES ('20120127143054')
26
- Migrating to AddUrlToSpudPostCategories (20120127144942)
27
-  (196.9ms) ALTER TABLE `spud_post_categories` ADD `parent_id` int(11) DEFAULT 0
28
-  (220.7ms) ALTER TABLE `spud_post_categories` ADD `url_name` varchar(255)
29
-  (179.0ms) CREATE INDEX `index_spud_post_categories_on_parent_id` ON `spud_post_categories` (`parent_id`)
30
-  (178.4ms) CREATE INDEX `index_spud_post_categories_on_url_name` ON `spud_post_categories` (`url_name`)
31
-  (0.6ms) INSERT INTO `schema_migrations` (`version`) VALUES ('20120127144942')
32
- Migrating to AddIsNewsToSpudPosts (20120210165540)
33
-  (207.1ms) ALTER TABLE `spud_posts` ADD `is_news` tinyint(1) DEFAULT 0
34
-  (212.3ms) CREATE INDEX `index_spud_posts_on_is_news` ON `spud_posts` (`is_news`)
35
-  (0.8ms) INSERT INTO `schema_migrations` (`version`) VALUES ('20120210165540')
36
-  (0.2ms) SELECT `schema_migrations`.`version` FROM `schema_migrations`