-
Is it possible to dynamically add attributes to a Virtus model?
I'm building a form builder, and when I load the Virtus model, I want to pass a collection of attributes to a method I define. I want…
-
I've just started playing with perpetuity so this is tentative suggestion :smile:
I wonder if it would be worth calling `to_s` on the given id in `Perpetuity::MongoDB#find` https://github.com/jgaski…
-
Is there a plan to support [Set](https://ruby-doc.org/stdlib-2.6.5/libdoc/set/rdoc/Set.html)?
I am trying to use dry-types in place of Virtus in [Grape](https://github.com/ruby-grape/grape/issues/1…
-
*Contexto*
En los últimos tres años, hemos empujado a la generación de datos abiertos en el tema de colisiones viales en la Zona Metropolitana de Monterrey. El día de hoy, queremos aprovechar esa inf…
-
``` ruby
require 'virtus'
class OneField
include Virtus.model
attribute :one, String
end
module OtherField
include Virtus.module
attribute :two, Integer
end
obj = OneField.new one: 13
puts…
k3rni updated
7 years ago
-
Using virtus 1.0.3 I get this behavior when attempting custom coercion with an array:
``` ruby
class MyInt < Virtus::Attribute
def coerce(value)
value.to_i
end
end
class Thing
include Virt…
-
**Describe the bug**
On #8669 we've migrated from `Virtus` to `ActiveModel::Attributes`.
For better backward compatibility, we've left that attributes can be defined as symbols, just like `Virt…
-
When a value is `nil` `Coercible::UnsupportedCoercion` is raised. This raise is a real expensive operation. When I simply create a virtus model 1000.times I get the following profile result
``` ruby
…
-
Custom coercers don't raise any errors if they fail to coerce a value to a given primitive.
``` ruby
class FunkyInteger < Virtus::Attribute
primitive Integer
def coerce(value)
'not an intege…
-
We have a class like so:
```
class Parent
include Virtus
attribute :foo
def self.inherited(subclass)
blahblah(subclass)
end
end
class Child < Parent
end
```
We upgraded to 1.0.0, repla…