DBF 1.0.9 update
DBF is a small fast Ruby library for reading dBase, xBase, Clipper and FoxPro database files
Changes in version 1.0.9:
- Fix incorrect integer column values (only affecting some dbf files)
- Add CSV export
DBF is a small fast Ruby library for reading dBase, xBase, Clipper and FoxPro database files
Changes in version 1.0.9:
In just about every Rails project I’ve worked on over the last several years we’ve needed track the user who creates and updates database records. The most popular solution seems to be DeLynn Berry’s userstamp plugin and, until recently, that’s what we’ve always chosen to use too. But after fighting incompatibility with newer versions of Rails I decided to write my own plugin. Enter Blame.
Blame automatically userstamps create and update operations if the table has columns named created_by and/or updated_by.
Installation:
ruby script/plugin install git://github.com/infused/blame.git
Blame assumes that you are using restful-authentication and expects User.current_user to return the current user. You can override this behavior by overriding the default userstamp_object method in ActiveRecord::Base or in any of your models. For example, maybe you just want to find the current user bases on the a session variable:
# In environment.rb class ActiveRecord::Base def userstamp_object User.find(session[:user_id]) end end
Maybe you don’t like the default column names of created_by/updated_by. You can customize the column names globally or for individual models:
# Globally in environment.rb ActiveRecord::Base.created_userstamp_column = :creator_id # In a model definition class Subscription self.created_userstamp_column = :creator_id self.updated_userstamp_column = :updater_id end
Automatic userstamping can be turned off by setting record_userstamps:
# Globally in environment.rb ActiveRecord::Base.record_userstamps = false # In a model definition class Subscription self.record_userstamps = false end
Blame also adds a migration helper which will add the created_by and updated_by columns (or your custom column names) to your table:
create_table :widgets do |t| t.string :name t.timestamps t.userstamps end
DBF is a small fast library for reading dBase, xBase, Clipper and FoxPro database files. It is written completely in Ruby and has no external dependencies.
Changes in version 1.0.5:
DBF is a small fast library for reading dBase, xBase, Clipper and FoxPro database files. It is written completely in Ruby and has no external dependencies.
Changes in version 1.0.2:
A lot of work has gone into this release of the DBF gem. The basic reader code is stable now. I’m in the process of moving the test suite from Test::Unit to Rspec. When I’m done with that I’ll add a couple of additional features, polish the documentation and christen it 1.0.0.