beef-articles 0.3.11 → 0.3.12
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/app/controllers/admin/articles_controller.rb +1 -1
- data/app/controllers/articles_controller.rb +1 -1
- data/app/models/article.rb +8 -0
- data/app/models/category.rb +1 -0
- data/app/models/comment.rb +2 -0
- data/articles.gemspec +1 -1
- metadata +3 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.3.
|
1
|
+
0.3.12
|
@@ -5,7 +5,7 @@ class Admin::ArticlesController < Admin::BaseController
|
|
5
5
|
# GET /articles
|
6
6
|
# GET /articles.xml
|
7
7
|
def index
|
8
|
-
@articles = Article.paginate :page => params[:page], :order => sort_order(:default => 'desc')
|
8
|
+
@articles = Article.paginate :page => params[:page], :per_page => 20, :order => sort_order(:default => 'desc')
|
9
9
|
|
10
10
|
respond_to do |format|
|
11
11
|
format.html # index.html.erb
|
@@ -18,7 +18,7 @@ class ArticlesController < ApplicationController
|
|
18
18
|
@page_title << " from #{params[:day]} #{Date::MONTHNAMES[params[:month].to_i] unless params[:month].nil?} #{params[:year]}"
|
19
19
|
end
|
20
20
|
|
21
|
-
@articles = Article.in_time_delta( params[:year], params[:month], params[:day] ).published.tagged_with(params[:tag], :on => :tags).authored_by(@user).categorised(@category).paginate( :page => params[:page], :per_page => params[:per_page] ||
|
21
|
+
@articles = Article.in_time_delta( params[:year], params[:month], params[:day] ).published.tagged_with(params[:tag], :on => :tags).authored_by(@user).categorised(@category).paginate( :page => params[:page], :per_page => params[:per_page] || Article.per_page, :include => [:created_by] )
|
22
22
|
|
23
23
|
@tags = Article.published.authored_by(@user).categorised(@category).tag_counts
|
24
24
|
|
data/app/models/article.rb
CHANGED
@@ -1,4 +1,6 @@
|
|
1
1
|
class Article < ActiveRecord::Base
|
2
|
+
unloadable
|
3
|
+
|
2
4
|
belongs_to :category
|
3
5
|
|
4
6
|
acts_as_content_node
|
@@ -23,8 +25,14 @@ class Article < ActiveRecord::Base
|
|
23
25
|
{ :conditions => ['published_at BETWEEN ? AND ?', from, to ] }
|
24
26
|
}
|
25
27
|
|
28
|
+
default_scope :order => 'published_at DESC'
|
29
|
+
|
26
30
|
validates_presence_of :body, :description, :tag_list, :if => :publish
|
27
31
|
|
32
|
+
# Default per page options
|
33
|
+
cattr_accessor :per_page
|
34
|
+
@@per_page = 10
|
35
|
+
|
28
36
|
# Finds one article which was posted on a certain date and matches the supplied dashed-title
|
29
37
|
def self.find_by_permalink(year, month, day, permalink)
|
30
38
|
if result = in_time_delta(year, month, day).first( :conditions => ["permalink = ?", permalink] )
|
data/app/models/category.rb
CHANGED
data/app/models/comment.rb
CHANGED
data/articles.gemspec
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: beef-articles
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Steve England
|
@@ -81,6 +81,7 @@ files:
|
|
81
81
|
- test/test_helper.rb
|
82
82
|
has_rdoc: false
|
83
83
|
homepage: http://github.com/beef/articles
|
84
|
+
licenses:
|
84
85
|
post_install_message:
|
85
86
|
rdoc_options:
|
86
87
|
- --charset=UTF-8
|
@@ -101,7 +102,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
101
102
|
requirements: []
|
102
103
|
|
103
104
|
rubyforge_project:
|
104
|
-
rubygems_version: 1.
|
105
|
+
rubygems_version: 1.3.5
|
105
106
|
signing_key:
|
106
107
|
specification_version: 3
|
107
108
|
summary: Article/Blogging engine
|