Skip to content

Commit

Permalink
Fixed a bug when trying to use Cell::Base.add_view_path in a Rails ap…
Browse files Browse the repository at this point in the history
…plication. Thanks to José Alberto [jalberto] for pointing me to that.. eh... bug.
  • Loading branch information
apotonick committed Jun 28, 2010
1 parent 88c4f6f commit 727c863
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
5 changes: 3 additions & 2 deletions cells.gemspec
Expand Up @@ -5,18 +5,19 @@

Gem::Specification.new do |s|
s.name = %q{cells}
s.version = "3.3.3"
s.version = "3.3.4"

s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["Nick Sutterer"]
s.date = %q{2010-04-17}
s.date = %q{2010-06-28}
s.description = %q{Cells are lightweight controllers for Rails and can be rendered in controllers and views, providing an elegant and fast way for encapsulation and component-orientation.}
s.email = %q{apotonick@gmail.com}
s.extra_rdoc_files = [
"README.rdoc"
]
s.files = [
"CHANGES",
"Gemfile",
"MIT-LICENSE",
"README.rdoc",
"Rakefile",
Expand Down
2 changes: 1 addition & 1 deletion lib/cells/cell/base.rb
Expand Up @@ -158,7 +158,7 @@ def view_paths=(paths)
# just RAILS_ROOT/app/cells, but you might want to add e.g.
# RAILS_ROOT/app/views.
def add_view_path(path)
path = ::Rails.root.join(path) if defined?(::Rails)
path = File.join(::Rails.root, path) if defined?(::Rails) and ::Rails.respond_to?(:root)
self.view_paths << path unless self.view_paths.include?(path)
end

Expand Down
2 changes: 1 addition & 1 deletion lib/cells/version.rb
@@ -1,5 +1,5 @@
# encoding: utf-8

module Cells
VERSION = '3.3.3'
VERSION = '3.3.4'
end
5 changes: 5 additions & 0 deletions test/cells_test.rb
Expand Up @@ -128,6 +128,11 @@ def test_cells_view_paths=
end
end

def test_add_view_path
Cell::Base.add_view_path 'now'
assert_kind_of ActionView::PathSet, Cell::Base.view_paths
end


def test_controller_render_methods
get :call_render_cell_with_strings # render_cell("test", "state")
Expand Down

0 comments on commit 727c863

Please sign in to comment.