myexperiment-hackers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[myexperiment-hackers] [2776] branches/elico/app: Fixed caching error wh


From: noreply
Subject: [myexperiment-hackers] [2776] branches/elico/app: Fixed caching error when changing group sharing and layout in one action
Date: Mon, 31 Oct 2011 11:46:24 -0400 (EDT)

Revision
2776
Author
fbacall
Date
2011-10-31 11:46:24 -0400 (Mon, 31 Oct 2011)

Log Message

Fixed caching error when changing group sharing and layout in one action

Modified Paths

Diff

Modified: branches/elico/app/controllers/application.rb (2775 => 2776)


--- branches/elico/app/controllers/application.rb	2011-10-31 14:56:05 UTC (rev 2775)
+++ branches/elico/app/controllers/application.rb	2011-10-31 15:46:24 UTC (rev 2776)
@@ -1168,7 +1168,8 @@
       object.contribution.save
     else
       network = Network.find(network_id.to_i)
-      if network && find_permission_for_contributor(object.contribution.policy.permissions, "Network", network_id.to_i)
+      # Have to call .reload on permissions or the cached permissions from before "update_policy" was called are used
+      if network && find_permission_for_contributor(object.contribution.policy.permissions.reload, "Network", network_id.to_i)
         object.contribution.layout = network.layout_name
         object.contribution.save
       else

Modified: branches/elico/app/views/contributions/_sharing_form.rhtml (2775 => 2776)


--- branches/elico/app/views/contributions/_sharing_form.rhtml	2011-10-31 14:56:05 UTC (rev 2775)
+++ branches/elico/app/views/contributions/_sharing_form.rhtml	2011-10-31 15:46:24 UTC (rev 2776)
@@ -173,7 +173,7 @@
             by visiting the 'edit' page.
           </p>
         </div>
-        <%= select_tag "layout", "<option value="">Default</option>" + options_from_collection_for_select(applicable_networks.select {|n| n.layout_name}, 'id','title') %>
+        <%= select_tag "layout", "<option value="">Default</option>" + options_from_collection_for_select(applicable_networks.select {|n| n.layout_name}, 'id','title', (Conf.layouts[contributable.contribution.layout]["network_id"] unless contributable.contribution.layout.nil?)) %>
         <%# TODO: In Rails 2, have a link that allows a user to preview the selected layout using polymorphic_path %>
       </div>
     </div>

reply via email to

[Prev in Thread] Current Thread [Next in Thread]