lib/sequel/plugins/bitemporal.rb in sequel_bitemporal-0.8.0 vs lib/sequel/plugins/bitemporal.rb in sequel_bitemporal-0.8.1
- old
+ new
@@ -59,11 +59,10 @@
@audit_class = opts[:audit_class]
@audit_updated_by_method = opts.fetch(:audit_updated_by_method){ :updated_by }
@propagate_per_column = opts.fetch(:propagate_per_column, false)
@version_uses_string_nilifier = version.plugins.map(&:to_s).include? "Sequel::Plugins::StringNilifier"
@excluded_columns = Sequel::Plugins::Bitemporal.bitemporal_excluded_columns
- @excluded_columns += columns
@excluded_columns += Array opts[:excluded_columns] if opts[:excluded_columns]
@use_ranges = if opts[:ranges]
db = self.db
unless db.database_type==:postgres && db.server_version >= 90200
raise "Ranges require PostgreSQL 9.2"
@@ -173,10 +172,10 @@
}
master.destroy_version self, expand_previous_version
end
end
unless opts[:delegate]==false
- (version.columns-master.excluded_columns).each do |column|
+ (version.columns-master.columns-master.excluded_columns).each do |column|
master.class_eval <<-EOS
def #{column}
pending_or_current_version.#{column} if pending_or_current_version
end
EOS