8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
# File 'lib/torque/postgresql/attributes/builder.rb', line 8
def self.include_on(klass, method_name, builder_klass, **, &block)
klass.define_singleton_method(method_name) do |*args, **options|
return unless connection.table_exists?(table_name)
args.each do |attribute|
begin
builder = builder_klass.new(self, attribute, .merge(options))
builder.conflicting?
builder.build
instance_exec(builder, &block) if block.present?
rescue Interrupt
end
end
end
end
|