wheels 0.0.32 → 0.0.33
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/app/controllers/blogs_controller.rb +7 -2
- data/wheels.gemspec +1 -1
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.33
|
@@ -1,16 +1,21 @@
|
|
1
1
|
class BlogsController < InheritedResources::Base
|
2
2
|
respond_to :html, :xml
|
3
|
-
before_filter
|
3
|
+
before_filter :load_maybe
|
4
4
|
has_scope :tagged_with, :as => :tag
|
5
5
|
belongs_to :user, :optional => true
|
6
6
|
|
7
|
+
def load_maybe
|
8
|
+
unless params[:user_id]
|
9
|
+
@user = (current_user || User.root)
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
7
13
|
def collection
|
8
14
|
@blogs ||= end_of_association_chain.
|
9
15
|
paginate(:page => params[:page], :order => 'created_at DESC' )
|
10
16
|
end
|
11
17
|
|
12
18
|
def begin_of_association_chain
|
13
|
-
@user ||= (current_user || User.root)
|
14
19
|
@tags = Blog.where(:user_id=>@user.id).tag_counts.sort{|t, u| t.count <=> u.count}
|
15
20
|
return @user
|
16
21
|
end
|
data/wheels.gemspec
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wheels
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 93
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 33
|
10
|
+
version: 0.0.33
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Tyler Gannon
|