Created
June 9, 2014 21:37
-
-
Save meskallito/5288591020f64259a4e3 to your computer and use it in GitHub Desktop.
Inserting of custom diff logic
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class AlterDiffLogicForInvoiceCharges < ActiveRecord::Migration | |
| def change | |
| alter_diff_calculations :invoice_charges, %{ | |
| excluded_cols := array_cat(excluded_cols,'{user_id, properties}'::text[]); | |
| changes = ((hstore(NEW.*) - hstore(OLD.*)) - excluded_cols) || (hstore(NEW.properties) - hstore(OLD.properties)); | |
| } | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment