social_stream-base 0.21.0 → 0.21.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -70,59 +70,6 @@ class Activity < ActiveRecord::Base
70
70
  merge(Audience.where(:relation_id => Relation.ids_shared_with(subject)))
71
71
  }
72
72
 
73
- scope :wall, lambda { |args|
74
- q =
75
- select("DISTINCT activities.*").
76
- joins(:audiences).
77
- joins(:relations).
78
- roots
79
-
80
- if args[:object_type].present?
81
- q = q.joins(:activity_objects).
82
- where('activity_objects.object_type' => args[:object_type])
83
- end
84
-
85
- audiences = Audience.arel_table
86
- relations = Relation.arel_table
87
-
88
- owner_conditions =
89
- arel_table[:author_id].eq(Actor.normalize_id(args[:owner])).
90
- or(arel_table[:user_author_id].eq(Actor.normalize_id(args[:owner]))).
91
- or(arel_table[:owner_id].eq(Actor.normalize_id(args[:owner])))
92
-
93
- audience_conditions =
94
- audiences[:relation_id].in(args[:relation_ids]).
95
- or(relations[:type].eq('Relation::Public'))
96
-
97
- conds =
98
- case args[:type]
99
- when :home
100
- followed_conditions =
101
- arel_table[:author_id].in(args[:followed]).
102
- or(arel_table[:owner_id].in(args[:followed]))
103
-
104
- owner_conditions.
105
- or(followed_conditions.and(audience_conditions))
106
- when :profile
107
- if args[:for].present?
108
- visitor_conditions =
109
- arel_table[:author_id].eq(Actor.normalize_id(args[:for])).
110
- or(arel_table[:owner_id].eq(Actor.normalize_id(args[:for])))
111
-
112
- owner_conditions.
113
- and(visitor_conditions.or(audience_conditions))
114
- else
115
- owner_conditions.
116
- and(audience_conditions)
117
- end
118
- else
119
- raise "Unknown wall type: #{ args[:type] }"
120
- end
121
-
122
- q.where(conds).
123
- order("created_at desc")
124
- }
125
-
126
73
  after_create :increment_like_count
127
74
  after_destroy :decrement_like_count, :delete_notifications
128
75
 
@@ -55,6 +55,8 @@ class Relation < ActiveRecord::Base
55
55
  has_many :audiences, :dependent => :destroy
56
56
  has_many :activities, :through => :audiences
57
57
 
58
+ has_many :activity_object_audiences, :dependent => :destroy
59
+
58
60
  scope :actor, lambda { |a|
59
61
  where(:actor_id => Actor.normalize_id(a))
60
62
  }
@@ -1,6 +1,6 @@
1
1
  <% if @profile.valid? %>
2
2
  <% flash[:notice] = t('profile.update.success') %>
3
- document.location.href="<%= resource_path(@profile) %>";
3
+ document.location.href="<%= polymorphic_path([ current_subject, :profile ]) %>";
4
4
  <% else %>
5
5
  if ($("#profile_notice").length == 0){
6
6
  $("#profile_form").prepend('<div id="profile_notice" class="notice"></div>');
@@ -38,7 +38,7 @@ en:
38
38
  public:
39
39
  summary: "Public"
40
40
  full: "Shared with all the Internet"
41
- show: "Mostrar"
41
+ show: "Show"
42
42
  visible:
43
43
  summary: "Restricted"
44
44
  full: "Shared with %{audience}"
@@ -38,7 +38,7 @@ es:
38
38
  public:
39
39
  summary: "Público"
40
40
  full: "Accesible por toda Internet"
41
- show: "Show"
41
+ show: "Mostrar"
42
42
  visible:
43
43
  summary: "Restringido"
44
44
  full: "Compartido con %{audience}"
@@ -1,5 +1,5 @@
1
1
  module SocialStream
2
2
  module Base
3
- VERSION = "0.21.0".freeze
3
+ VERSION = "0.21.1".freeze
4
4
  end
5
5
  end
@@ -38,6 +38,13 @@ describe ProfilesController do
38
38
  response.should redirect_to([@user, :profile])
39
39
  end
40
40
 
41
+ it "should update via AJAX" do
42
+ put :update, :user_id => @user.to_param, :profile => { :organization => "Social Stream" }, :format => :js
43
+
44
+ response.should be_success
45
+ end
46
+
47
+
41
48
  it "should not update other's" do
42
49
  begin
43
50
  put :update, :user_id => Factory(:user).to_param, :profile => { :organization => "Social Stream" }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: social_stream-base
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.21.0
4
+ version: 0.21.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2012-05-27 00:00:00.000000000 Z
13
+ date: 2012-06-06 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: deep_merge