Skip to content

Instantly share code, notes, and snippets.

@AnyMetaDef(idType = "long", metaType = "long", metaValues = {
@MetaValue(value = "1", targetEntity = Restaurante.class),
@MetaValue(value = "2", targetEntity = Prato.class) })
class Picapau
def voa
p 'estou voando'
end
end
woody = Picapau.new
amigo = Picapau.new
woody.voa # => estou voando
Usuario.where('login in (?)', ['a', 'b', 'c']).each do|u|
u.update_attribute :status, :bloqueado
end
Usuario.where('login in (?)', ['a', 'b', 'c']).update_all( status: :bloqueado )