This file contains 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
module ActiveRecord | |
module ConnectionAdapters | |
class PostgreSQLAdapter < AbstractAdapter | |
# For some reason, I have to override these two methods, or record ids don't get updated in | |
# the object after creating an object. | |
def prefetch_primary_key?(table_name = nil) | |
true | |
end | |
def next_sequence_value(sequence_name = nil) | |
query("SELECT nextval('#{sequence_name}')")[0][0] |
This file contains 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
require 'active_record' | |
# ClassTableInheritance is an ActiveRecord plugin designed to allow | |
# simple multiple table (class) inheritance. | |
class ActiveRecord::Base | |
attr_reader :reflection | |
def self.inherits_from(association_id) | |
# add an association, and set the foreign key. |