4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
# File 'lib/vhost/site_scoped_model_extensions.rb', line 4
def self.included(base)
base.class_eval {
self.clear_callbacks_by_calling_method_name(:validate, :validates_uniqueness_of)
validates_presence_of :site_id
belongs_to :site
config = VhostExtension.MODEL_UNIQUENESS_VALIDATIONS[self.name]
unless config.nil?
config.each_pair do |attr, params|
unless attr == 'sti_classes'
validates_uniqueness_of attr.to_sym, params.symbolize_keys
end
end
end
}
end
|