Commit 63f275e7a7ce22e36c4bdad80abddb427ddeb8e8
1 parent
6a5e4e61
Exists in
master
and in
28 other branches
r230@sede: terceiro | 2007-07-28 17:03:52 -0300
ActionItem0: adding MainBlock from old flexible_template git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@234 3f533792-8f58-4932-b0fe-aaf55b0a4547
Showing
3 changed files
with
31 additions
and
1 deletions
Show diff stats
@@ -0,0 +1,17 @@ | @@ -0,0 +1,17 @@ | ||
1 | +module Design | ||
2 | + | ||
3 | + # Block subclass to represent blocks that must contain the main content, i.e. | ||
4 | + # the result of the controller action, or yet, the value you would get by | ||
5 | + # calling +yield+ inside a regular view. | ||
6 | + class MainBlock < Block | ||
7 | + | ||
8 | + set_table_name | ||
9 | + | ||
10 | + # always returns true | ||
11 | + def main? | ||
12 | + true | ||
13 | + end | ||
14 | + | ||
15 | + end | ||
16 | + | ||
17 | +end |
vendor/plugins/design/test/test_helper.rb
@@ -8,7 +8,9 @@ ActiveRecord::Base.logger = Logger.new(File.dirname(__FILE__) + "/debug.log") | @@ -8,7 +8,9 @@ ActiveRecord::Base.logger = Logger.new(File.dirname(__FILE__) + "/debug.log") | ||
8 | load(File.dirname(__FILE__) + '/schema.rb') | 8 | load(File.dirname(__FILE__) + '/schema.rb') |
9 | # change the table names for the tests to not touch | 9 | # change the table names for the tests to not touch |
10 | Design::Box.set_table_name 'design_test_design_boxes' | 10 | Design::Box.set_table_name 'design_test_design_boxes' |
11 | -Design::Block.set_table_name 'design_test_design_blocks' | 11 | +[Design::Block, Design::MainBlock].each do |item| |
12 | + item.set_table_name 'design_test_design_blocks' | ||
13 | +end | ||
12 | 14 | ||
13 | # example class to hold some blocks | 15 | # example class to hold some blocks |
14 | class DesignTestUser < ActiveRecord::Base | 16 | class DesignTestUser < ActiveRecord::Base |