Skip to content

Commit

Permalink
Language association in Category
Browse files Browse the repository at this point in the history
janv committed Dec 9, 2009
1 parent 7c14ec1 commit 866ddfe
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions app/models/category.rb
Original file line number Diff line number Diff line change
@@ -5,6 +5,7 @@ class Category < ActiveRecord::Base
has_many :documents, :order => :position
belongs_to :parent,
:class_name => 'Category'
belongs_to :language
has_many :collections, :dependent => :destroy, :as => :collectionable
has_many :assets, :order => "position", :dependent => :destroy, :as => :assetable

2 changes: 1 addition & 1 deletion app/views/vrame/categories/_form.html.erb
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@

<li class="last">
<%= f.label :parent_id, 'Eltern-Kategorie:' %>
<%= tree_select(:category, :parent_id, controller.category_by_language.roots, :id, :title, :include_blank => true) %>
<%= tree_select(:category, :parent_id, Category.by_language(category.language).roots, :id, :title, :include_blank => true) %>
</li>
</ul>
</fieldset>

0 comments on commit 866ddfe

Please sign in to comment.