Wolfmans Howlings

A programmers Blog about Programming solutions and a few other issues

metaWeblog api in typo fails on some posts

Posted by Jim Morris on 2006-06-03 23:32:02 +0000

I was using a ruby script to post my blogs from the command line, and it used the xmlrpc/client which would occasionally fail with this error...

/usr/local/lib/ruby/1.8/xmlrpc/client.rb:546:in `do_rpc': HTTP-Error: 500 Internal Server Error  (RuntimeError)
    from /usr/local/lib/ruby/1.8/xmlrpc/client.rb:420:in `call2'
    from /usr/local/lib/ruby/1.8/xmlrpc/client.rb:410:in `call'
    from send2blog.rb:103
... Show more ...

Posted in Rails,Ruby  |  Tags typo,metaweblog  |  1 comments

Capistrano deploy from local repository

Posted by Jim Morris on 2006-05-26 17:08:00 +0000

UPDATE 2006-12-06 I have replaced this with a full blown SCM module that works much better, see this posting

... Show more ...

Posted in Rails,Ruby  |  Tags ruby,rails,capistrano,deployment  |  no comments

Create Rails ActiveRecord Models from DDL

Posted by Jim Morris on 2006-05-24 23:20:00 +0000

I had a database with about 60 tables in it, most where simple lookup tables with simple has_many and belongs_to relationships, and I didn't want to manually create all the models, with the associations by hand. I googled around and came across Bill Katz's dbmodel, which takes the output of dbdesigner and creates the models with the relationships. However I already had the Databases and schema setup, and I didn't have (and couldn't find) a copy of dbdesigner to use. So I hacked Bills dbmodel to read a DDL file that was created from the command rake db:structure:dump, as I was using Postgresql this file had all the relevant relationship info in it plus a bit extra.

I added the ability to create the relationships that had non standard table names and foreign keys, and also added some validations to the created models.

... Show more ...

Posted in Rails,Ruby  |  Tags rails,ddl,activerecord  |  5 comments

An Admin page for Rails Role Based Authentication

Posted by Jim Morris on 2006-05-20 13:19:00 +0000

This is an example of an admin page for the Rails Recipes book Role Based Authentication, using a tree control and checkboxes for HABTM.

I used the Silverstripe tree control to render two trees, on the left a list of all Roles and what Rights they have. On the right a tree with all controllers and a checkbox for each action for each controller, under that a set of checkboxes that allow you to apply the selected rights to the selected Roles.

... Show more ...

Posted in Rails  |  Tags ruby,rails,rbac  |  10 comments