social_stream-documents 0.1.9 → 0.1.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/.rspec ADDED
@@ -0,0 +1 @@
1
+ --color
@@ -1,16 +1,10 @@
1
1
  class CommonDocumentsController < InheritedResources::Base
2
2
  belongs_to_subjects :optional => true
3
3
 
4
- load_and_authorize_resource
4
+ before_filter :subject!, :only => :index
5
+
6
+ load_and_authorize_resource :except => :index
5
7
 
6
- def index
7
- @activities = subject.wall(:profile,
8
- :for => current_subject,
9
- :object_type => Array(self.class.index_object_type)).
10
- page(params[:page]).
11
- per(params[:per])
12
- end
13
-
14
8
  def show
15
9
  path = resource.file.path(params[:style])
16
10
 
@@ -33,7 +27,19 @@ class CommonDocumentsController < InheritedResources::Base
33
27
  private
34
28
 
35
29
  def subject
36
- @subject ||= parent || current_subject
30
+ @subject ||= association_chain[-1] || current_subject
31
+ end
32
+
33
+ def subject!
34
+ @subject ||= association_chain[-1] || warden.authenticate!(:user)
35
+ end
36
+
37
+ def collection
38
+ @activities = subject.wall(:profile,
39
+ :for => current_subject,
40
+ :object_type => Array(self.class.index_object_type)).
41
+ page(params[:page]).
42
+ per(params[:per])
37
43
  end
38
44
 
39
45
  class << self
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "social_stream-documents"
3
- s.version = "0.1.9"
3
+ s.version = "0.1.10"
4
4
  s.authors = ["Víctor Sánchez Belmar", "GING - DIT - UPM"]
5
5
  s.summary = "File capabilities for Social Stream, the core for building social network websites"
6
6
  s.description = "Social Stream is a Ruby on Rails engine providing your application with social networking features and activity streams.\n\nThis gem allow you upload almost any kind of file as new social stream activity."
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: social_stream-documents
3
3
  version: !ruby/object:Gem::Version
4
- hash: 9
4
+ hash: 15
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 9
10
- version: 0.1.9
9
+ - 10
10
+ version: 0.1.10
11
11
  platform: ruby
12
12
  authors:
13
13
  - "V\xC3\xADctor S\xC3\xA1nchez Belmar"
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2011-07-21 00:00:00 +02:00
19
+ date: 2011-07-22 00:00:00 +02:00
20
20
  default_executable:
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency
@@ -197,6 +197,7 @@ files:
197
197
  - .idea/modules.xml
198
198
  - .idea/social_stream-documents.iml
199
199
  - .idea/vcs.xml
200
+ - .rspec
200
201
  - Gemfile
201
202
  - MIT-LICENSE
202
203
  - README.rdoc