Building Bricks

7 views
Skip to first unread message

JB

unread,
Apr 24, 2014, 2:31:34 AM4/24/14
to zena...@googlegroups.com
Hi all,

I tried to build a brick for test purposes.
I copied both the example given in "Building Bricks" page of zenadmin.org (http://zenadmin.org/en/documentation/Wiki/page503.html) and the sample "toto.zip" that can be found in the zena/bricks directory.

I dropped the "gardening" and "toto" directories into a "bricks" directory in my zena application (myapp/bricks)
I found that for the migration to take place, the migration file must be in a zena/migrate/ subdirectory of the brick (not migration/ directory). For example:
myapp/bricks/toto/zena/migrate/001_create_toto.rb

now running
rake zena:migrate RAILS_ENV='production'
actually creates the new database tables, and
rake zena:migrate VERSION=0 BRICK=toto
drops the table.

The problem now is that I can't see any new class in the management/classes section of the site. I was expecting to get class Toto under Page.
I tried "clear cache" and "rebuild" without success.
The models are in myapp/bricks/toto/models/, is this the right directory?
Is there anything else to do after the migration or did I miss anything?
I'm still with Zena 1.2.7

Thanks for any help!

JB

unread,
Apr 24, 2014, 5:08:24 PM4/24/14
to zena...@googlegroups.com
Ok I found that the "models" part of the brick must be installed in the directory myapp/app/models/
This makes the new class to appear in the management/classes screen.

I removed the act_as_content" and "zafu_readable" in the models as they were creating following errors:
undefined local variable or method `act_as_content' for PlantContent(id: integer, version_id: integer, brand: string):Class
undefined method `zafu_readable' for PlantContent(id: integer, version_id: integer, brand: string):Class

Any ideas to correct this?
Reply all
Reply to author
Forward
0 new messages