module Tracker::Migration
Public Instance Methods
migrate!()
click to toggle source
# File lib/tracker/migration.rb, line 9 def migrate! template = File.read(File.dirname(__FILE__) + "/tracker.sql") renderer = ERB.new(template) options = Options.new(reinstall: false) sql = options.render(renderer) ActiveRecord::Base.connection.execute sql end
track_table!(table)
click to toggle source
# File lib/tracker/migration.rb, line 18 def track_table!(table) sql = "SELECT tracker.track_table('#{table}', 'id', array['created_at','updated_at', 'tsv', 'pg_search'])" ActiveRecord::Base.connection.execute sql end