audit_rails 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -16,15 +16,16 @@ gem ‘audit_rails’
16
16
 
17
17
  rails g audit_rails:install
18
18
 
19
- == To add audit migration:
19
+ = Usage
20
+ === To add audit migration:
20
21
 
21
22
  rake audit_rails:install:migrations
22
23
 
23
- == Add audit.js to application.js file:
24
+ === Add audit.js to application.js file:
24
25
 
25
26
  //= require audit_rails/audit
26
27
 
27
- == To add additional attributes to Audit (let's say book_id):
28
+ === To add additional attributes to Audit (let's say book_id):
28
29
  1. Add attributes to migration generated from above rake task
29
30
  2. Inherit from AuditRails::Audit:
30
31
  #MyApp/app/models/audit.rb
@@ -36,19 +37,23 @@ rake audit_rails:install:migrations
36
37
  belongs_to :book
37
38
  end
38
39
 
39
- == To log user events, simply call 'add_to_audit' with desired parameters in any controller (as this is now a helper method included in application_controller.rb of application)
40
+ === To log user events
41
+ Simply call 'add_to_audit' with desired parameters in any controller (as this is now a helper method included in application_controller.rb of application)
40
42
 
41
- == To override controller's add_to_audit method (or the helper method), simply re-implement in application_controller.rb
43
+ === To override controller's add_to_audit method (or the helper method)
44
+ Simply re-implement in application_controller.rb
42
45
 
43
- == To track user login (one per day), override current_user method in application controller, e.g.:
46
+ === To track user login (one per day)
47
+ Override current_user method in application controller, e.g.:
44
48
  def current_user
45
49
  add_to_audit('login', 'sessions', "John Smith")
46
50
  super
47
51
  end
48
52
 
49
- == To see all audits go to <app-url>/audit_rails/audits
53
+ === To see all audits
54
+ Go to <app-url>/audit_rails/audits
50
55
 
51
- == To download the audit report as xls file:
56
+ === To download the audit report as xls file:
52
57
  * Add this to initializers/mime_types.rb
53
58
  Mime::Type.register "application/vnd.ms-excel", :xls
54
59
 
@@ -65,4 +70,4 @@ You are welcome to contribute and add more feature to this gem. I have added rsp
65
70
  Please fork it, add specs and send a pull request!
66
71
 
67
72
  = License
68
- This project rocks and uses MIT-LICENSE.
73
+ This project rocks and uses MIT-LICENSE.
@@ -1,4 +1,4 @@
1
- $("a.visit-site").live("click", function() {
1
+ $(document).on("click", 'a.visit-site', function() {
2
2
  params = { audit: { url: this.href, app_id: $("a.visit-site").attr("data-app-id") } };
3
3
  $.post("/audit_rails/audits", params);
4
4
  window.open(this.href);
@@ -1,3 +1,3 @@
1
1
  module AuditRails
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: audit_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: