For now, here are a couple of quick examples.
login.rb - this is simply a rewrite of a PerlScript example they have on their website. Except in Ruby.
bcbstn_download.rb- a script that connects to an insurance payer BBS (in this case BCBS of Tennessee) and downloads all available files. There is more work that I have to do here, but this shows usage of ActiveRecord to lookup various values from a database. I call this from the command line in a form like:
crt /script bcbstn_download.rb /arg 1
The arg is the ID of a record in the database... I won't go into that, but just know that ActiveRecord works from within these scripts. However, there are a couple of things.
- I have to use set_table_name within the ActiveRecord class definition even when the underlying table follows the normal ActiveRecord naming convention. It refused to work without it.
- Associations (has_and_belongs_to_many, etc...) do not seem to be working. I haven't had a chance to investigate this yet. And yes I know that the example script doesn't contain any of these associations. I took them out for now.
I'll be posting some more information as I get a chance to work on this more.]

0 comments:
Post a Comment