record_activities Rails Plugin for Activity Logging in 16LOC

Since most activity logging solutions out there are either complex or require controller hacking i based this new dead-simple activity logging plugin on userstamps.

Thats 16LOC for complete activity logging

Record Activities Rails plugin


class Comment < ActiveRecord::Base
  stampable
  record_activities #same as record_activities  :create, :update
end
Comment.create! -> Activity(:subject=>comment,:actor=>current_user,:action=>'create')


Load All Fixtures (when not in test…)

For tests we have the `fixtures :all`. But for other usages fixture loading is idiotically hard…

Fixtures.create_fixtures(folder, file) should just load all when no file is given, but alas we have to do this ourselves…

#Load all fixtures
Fixtures.reset_cache  #only needed when you reload them
fixtures_folder = File.join(RAILS_ROOT, 'spec', 'fixtures')
fixtures = Dir[File.join(fixtures_folder, '*.yml')].map {|f| File.basename(f, '.yml') }
Fixtures.create_fixtures(fixtures_folder, fixtures)

TAP the Testable, Auto-documenting, Class-based Rake

UPDATE: always use “# YourClassName::manifest some-text” in the comments, or the task will not be found

If you have rake tasks and you work TDD then your doing it wrong!
Use TAP! Its like rake but auto-documenting + testable + awesome!

See the presentation!
See the slides.
See the website!
See the repo!

gem install tap

(If you really want to go crazy with sequenced task and all kinds of logic-task-chaining, this is possible too.)