Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed incorrect version of namespaces show on var page.

  • Loading branch information...
commit 190e95e468a16a504b072e2971643eee9b0f5c31 1 parent 5477bdc
@zk authored
View
11 app/controllers/main_controller.rb
@@ -197,7 +197,7 @@ def ns
def function
lib_url_name = params[:lib]
version = params[:version]
-
+
ns = params[:ns]
function_url_name = params[:function]
@@ -212,9 +212,10 @@ def function
@function = Function.find(
:first,
:include => [:namespace, {:namespace => :library}],
- :conditions => {
- :namespaces => {:name => ns, :libraries => {:url_friendly_name => lib_url_name, :current => true}},
- :url_friendly_name => function_url_name})
+ :conditions => {:namespaces => {:name => ns,
+ :libraries => {:url_friendly_name => lib_url_name,
+ :current => true}},
+ :url_friendly_name => function_url_name})
end
if not @function
@@ -242,8 +243,6 @@ def function
@comment.save
redirect_to @function.href
return
-
-
end
end
View
12 app/views/_lib_namespaces.html.erb
@@ -1,7 +1,15 @@
<%
if not @library
- @library = Library.find_by_url_friendly_name(params[:lib])
+
+ version = params[:version]
+ if version
+ @library =
+ Library.find_by_url_friendly_name_and_version(params[:lib], version)
+ else
+ @library =
+ Library.find_by_url_friendly_name_and_current(params[:lib],true)
+ end
end
current_ns = params[:ns]
@@ -88,4 +96,4 @@ _nss = treeify(Tree::TreeNode.new("ROOT", "root node"), _nss)
<h3>Namespaces</h3>
<% generate_level(@library, current_ns, _nss) %>
</div>
-<% end %>
+<% end %>
Please sign in to comment.
Something went wrong with that request. Please try again.