Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

update new changes #1

Merged
merged 5 commits into from

2 participants

@peterpengnz
Owner

No description provided.

and others added some commits
@peterpengnz Update README.textile
added documentation for globally turning ChangeLog off.
2b7fa19
@peterzatncs peterzatncs Merge pull request #1 from peterpengnz/patch-1
Update README.textile
38bc034
@peterpengnz add instructions to connect to different database
change_logs can save all transactions into separate database 
03b19a6
@peterzatncs peterzatncs Merge pull request #2 from peterpengnz/patch-2
add instructions to connect to different database
71252a1
@peterzatncs peterzatncs wording 51764d5
@peterpengnz peterpengnz merged commit e13b4db into peterpengnz:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Oct 9, 2012
  1. Update README.textile

    authored
    added documentation for globally turning ChangeLog off.
  2. @peterzatncs

    Merge pull request #1 from peterpengnz/patch-1

    peterzatncs authored
    Update README.textile
Commits on Dec 19, 2012
  1. add instructions to connect to different database

    authored
    change_logs can save all transactions into separate database 
  2. @peterzatncs

    Merge pull request #2 from peterpengnz/patch-2

    peterzatncs authored
    add instructions to connect to different database
  3. @peterzatncs

    wording

    peterzatncs authored
This page is out of date. Refresh to see the latest.
Showing with 31 additions and 6 deletions.
  1. +31 −6 README.textile
View
37 README.textile
@@ -116,16 +116,41 @@ ChangeLogs.find(:all,:conditions=>['user = ?', 'peterz'])</code></pre>
<pre><code># List all changes for table 'accounts'
ChangeLogs.find(:all,:conditions=>['table_name = ?', 'accounts'])</code></pre>
-* Note:
- It is ok if you want to use other table name instead of 'change_logs',
- choose your preferred table name and run the migration.
- Just remember in your environment.rb file, you need to tell change_log gem
- what is your table name:
+ 4. *Turn ChangeLogs off in testing environment*
+You can globally turn it off for your testing.
+<pre><code># config/environment.rb
+ChangeLog.enabled = false if RAILS_ENV == 'test'
+</code></pre>
+
+ 5. *Database and table name*
+change_log gem can save changes into separate database from the main application.
+The database could be MySQL, SQLite or any other database that active record is happy to connect with.
+
+Here is an example of database.yml when using separate database for 'change_logs':
+<pre><code>change_logs:
+ adapter: mysql2
+ encoding: utf8
+ database: change_logs
+ username: username
+ password: ********
+ host: hostname
+ port: 3306
+</code></pre>
+
+And also you need to tell change_log gem to establish the connection.
+<pre><code># config/environment.rb
+ChangeLogs.establish_connection(:change_logs)
+</code></pre>
+
+Table name is also configurable. Instead of 'change_logs', choose your preferred table name and run the migration.
+Just remember in your environment.rb file, you need to tell change_log gem
+what is your table name:
<pre><code># config/environment.rb
ChangeLogs.set_table_name('hr_maintenances')
</code></pre>
+
h2. Wish List
Please email me if you have any enquiry.
@@ -136,4 +161,4 @@ h3. Author
Peter Zhang at NCS New Zealand.
Email: peterz@ncs.co.nz
-Copyright (c) 2011 Peter Zhang and NCS LTD, released under the MIT license
+Copyright (c) 2011 Peter Zhang and NCS LTD, released under the MIT license
Something went wrong with that request. Please try again.