0.0
No commit activity in last 3 years
No release in over 3 years
Provides a simple activity logging and retrieval facility
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Runtime

>= 3.2.0
 Project Readme

ActivityLog

A very simple activity logging facility, used to record a log of events attached to a unique ID.

Installation

Add this line to your application's Gemfile:

gem 'activity_log'

And then execute:

$ bundle install

Or install it yourself as:

$ gem install activity_log

Once you have the gem installed execute:

$ rails g activity_log:install

followed by

$ rake db:migrate

This will create the activity_log_entry model and migration as well as creating the new table in the database.

Usage

Once installed you can then add new activity log entries with by first including the actvity_log library via:

class MyController < ApplicationController
  include ActivityLog

and use the following methods to add and retrieve activity log entries: Create a new entry:

ActivityLog.log(owner_id, "user logged in")

Retrieve a single entry

@entry = ActivityLog.get_by_id(activity_log_entry_id)

Retrieve all entries for a unique id

@entries = ActivityLog.get_by_owner(owner_id)

Retrieve all entries for a unique id within a specific timeframe

@entries = ActivityLog.get_by_owner_and_range(owner_id, start_date, end_date)

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request