lib/evil_seed/configuration.rb in evil-seed-0.4.0 vs lib/evil_seed/configuration.rb in evil-seed-0.5.0
- old
+ new
@@ -9,10 +9,11 @@
class Configuration
attr_accessor :record_dumper_class
def initialize
@record_dumper_class = RecordDumper
+ @ignored_columns = Hash.new { |h, k| h[k] = [] }
end
def roots
@roots ||= []
end
@@ -31,12 +32,20 @@
def anonymize(model_class, &block)
raise(ArgumentError, "You must provide block for #{__method__} method") unless block
customizers[model_class.to_s] << Anonymizer.new(model_class, &block)
end
+ def ignore_columns(model_class, *columns)
+ @ignored_columns[model_class] += columns
+ end
+
# Customizer objects for every model
# @return [Hash{String => Array<#call>}]
def customizers
@customizers ||= Hash.new { |h, k| h[k] = [] }
+ end
+
+ def ignored_columns_for(model_class)
+ @ignored_columns[model_class]
end
end
end