Skip to content

Commit

Permalink
Had to use fully defined 'Role' constant to avoid confusion with Prop…
Browse files Browse the repository at this point in the history
…erty::Role.
  • Loading branch information
gaspard committed Sep 28, 2010
1 parent de18439 commit c71f0de
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 13 deletions.
16 changes: 8 additions & 8 deletions app/controllers/virtual_classes_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ class VirtualClassesController < ApplicationController
layout :admin_layout

def index
secure(Role) do
@virtual_classes = Role.paginate(:all, :order => 'kpath', :per_page => 20, :page => params[:page])
secure(::Role) do
@virtual_classes = ::Role.paginate(:all, :order => 'kpath', :per_page => 20, :page => params[:page])
end

last_kpath = @virtual_classes.last.kpath
Expand All @@ -19,8 +19,8 @@ def index
@virtual_classes.sort! do |a, b|
if a.kpath == b.kpath
# Order VirtualClass first
b_type = b.kind_of?(Role) ? b.class.to_s : 'V' # sort real classes like VirtualClass
a_type = a.kind_of?(Role) ? a.class.to_s : 'V'
b_type = b.kind_of?(::Role) ? b.class.to_s : 'V' # sort real classes like VirtualClass
a_type = a.kind_of?(::Role) ? a.class.to_s : 'V'

b_type <=> a_type
else
Expand All @@ -37,8 +37,8 @@ def index
end

def export
data = secure(Role) do
Role.export
data = secure(::Role) do
::Role.export
end

### TODO
Expand Down Expand Up @@ -92,7 +92,7 @@ def edit
def create
type = params[:virtual_class].delete(:type)
if type == 'Role'
@virtual_class = Role.new(params[:virtual_class])
@virtual_class = ::Role.new(params[:virtual_class])
else
@virtual_class = VirtualClass.new(params[:virtual_class])
end
Expand Down Expand Up @@ -138,6 +138,6 @@ def destroy

protected
def find_virtual_class
@virtual_class = secure!(VirtualClass) { Role.find(params[:id])}
@virtual_class = secure!(VirtualClass) { ::Role.find(params[:id])}
end
end
2 changes: 1 addition & 1 deletion config/gems.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ yamltest: '>= 0.7.0'
rubyless: '>= 0.7.0'
property: '>= 1.2.0'
versions: '>= 0.3.1'
zafu: '>= 0.7.4'
zafu: '>= 0.7.5'

jeweler:

Expand Down
12 changes: 8 additions & 4 deletions zena.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Gem::Specification.new do |s|

s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version=
s.authors = ["Gaspard Bucher"]
s.date = %q{2010-09-26}
s.date = %q{2010-09-28}
s.default_executable = %q{zena}
s.description = %q{zena is a Ruby on Rails CMS (content managment system) with a focus on usability, ease of customization and web 2.0 goodness (application like behaviour).}
s.email = %q{gaspard@teti.ch}
Expand Down Expand Up @@ -434,6 +434,7 @@ Gem::Specification.new do |s|
"db/migrate/20100915062903_add_api_group_id_to_site.rb",
"db/migrate/20100923154807_remove_base_contact.rb",
"db/migrate/20100926192223_remove_su_user.rb",
"db/migrate/20100927141658_add_eval_attributes_to_v_class.rb",
"doc/README_FOR_APP",
"doc/fixtures.graffle",
"doc/fixtures.pdf",
Expand Down Expand Up @@ -542,6 +543,7 @@ Gem::Specification.new do |s|
"lib/zena/use/ml_index.rb",
"lib/zena/use/nested_attributes_alias.rb",
"lib/zena/use/node_name.rb",
"lib/zena/use/prop_eval.rb",
"lib/zena/use/query_builder.rb",
"lib/zena/use/query_comment.rb",
"lib/zena/use/query_node.rb",
Expand Down Expand Up @@ -1922,6 +1924,7 @@ Gem::Specification.new do |s|
"test/unit/zena/use/ml_index_test.rb",
"test/unit/zena/use/nested_attributes_alias_model_test.rb",
"test/unit/zena/use/nested_attributes_alias_view_test.rb",
"test/unit/zena/use/prop_eval_test.rb",
"test/unit/zena/use/query_node_test.rb",
"test/unit/zena/use/refactor_test.rb",
"test/unit/zena/use/rendering_test.rb",
Expand Down Expand Up @@ -2158,6 +2161,7 @@ Gem::Specification.new do |s|
"test/unit/zena/use/ml_index_test.rb",
"test/unit/zena/use/nested_attributes_alias_model_test.rb",
"test/unit/zena/use/nested_attributes_alias_view_test.rb",
"test/unit/zena/use/prop_eval_test.rb",
"test/unit/zena/use/query_node_test.rb",
"test/unit/zena/use/refactor_test.rb",
"test/unit/zena/use/rendering_test.rb",
Expand All @@ -2181,7 +2185,7 @@ Gem::Specification.new do |s|
s.add_runtime_dependency(%q<property>, [">= 1.2.0"])
s.add_runtime_dependency(%q<uuidtools>, ["= 2.0.0"])
s.add_runtime_dependency(%q<authlogic>, ["= 2.1.3"])
s.add_runtime_dependency(%q<zafu>, [">= 0.7.4"])
s.add_runtime_dependency(%q<zafu>, [">= 0.7.5"])
s.add_runtime_dependency(%q<shoulda>, [">= 2.10.2"])
s.add_runtime_dependency(%q<fast_gettext>, ["~> 0.4.16"])
s.add_runtime_dependency(%q<syntax>, ["= 1.0.0"])
Expand All @@ -2203,7 +2207,7 @@ Gem::Specification.new do |s|
s.add_dependency(%q<property>, [">= 1.2.0"])
s.add_dependency(%q<uuidtools>, ["= 2.0.0"])
s.add_dependency(%q<authlogic>, ["= 2.1.3"])
s.add_dependency(%q<zafu>, [">= 0.7.4"])
s.add_dependency(%q<zafu>, [">= 0.7.5"])
s.add_dependency(%q<shoulda>, [">= 2.10.2"])
s.add_dependency(%q<fast_gettext>, ["~> 0.4.16"])
s.add_dependency(%q<syntax>, ["= 1.0.0"])
Expand All @@ -2226,7 +2230,7 @@ Gem::Specification.new do |s|
s.add_dependency(%q<property>, [">= 1.2.0"])
s.add_dependency(%q<uuidtools>, ["= 2.0.0"])
s.add_dependency(%q<authlogic>, ["= 2.1.3"])
s.add_dependency(%q<zafu>, [">= 0.7.4"])
s.add_dependency(%q<zafu>, [">= 0.7.5"])
s.add_dependency(%q<shoulda>, [">= 2.10.2"])
s.add_dependency(%q<fast_gettext>, ["~> 0.4.16"])
s.add_dependency(%q<syntax>, ["= 1.0.0"])
Expand Down

0 comments on commit c71f0de

Please sign in to comment.