virtus icon indicating copy to clipboard operation
virtus copied to clipboard

[DISCONTINUED ] Attributes on Steroids for Plain Old Ruby Objects

Results 71 virtus issues
Sort by recently updated
recently updated
newest added

Without this fix, collection attributes can never be set to nil when coercion is enabled (because the coercer coerces nil to an empty array). This should fix #334. I originally...

This is a small hack, that fixes incorrect behaviour in #377. The problem, as I see it, is that `Virtus::Attribute::Boolean` has only `TrueClass` as a primitive. This makes `Virtus::TypeLookup` to...

```ruby require 'virtus' class SomeRandomClass end class User include Virtus.model(strict: true) attribute :some_ran_class, SomeRandomClass end User.new(some_ran_class: 5) # no error User.new() # no error User.new(some_ran_class: SomeRandomClass.new) # should be the...

I ran into the documented Boolean issue, and tried the workaround, which didn't help - I discovered I was able to make it work by using Virtus::Attribute::Boolean rather than Axiom::Types::Boolean.

Setting the default value to a hash (or empty array, or any other mutable object) can cause mutability/side-effect problems to be introduced. These are very hard and time-consuming to track...

Since parameters in Rails 5 no longer sub class from Hash and blow up when you try to call to_hash on them when they are not permitted the coerce method...

Hi, I can't find if the format for parsing dates can be configured somewhere. Is it possible to force a given format when parsing dates?

It would be nice to have a coercion like `FiexdWith`that you could inform parameters like : * width: Integer * alignment: {left, right} * padding : String Example : ```ruby...

I'm running into an error specifically with this line of code: https://github.com/solnic/virtus/blob/4db9ffd380b5e42baa56b9f96b8daebf12fad48f/lib/virtus/attribute_set.rb#L196 In Rails 4 and below calling `to_hash` on parameters was easy and returned the expected hash as follows:...

This MR adds the option `:allow_nil` to a `Virtus::Attribute`. The option allows the user to specify wether to use the default value of an attribute that got assigned as nil....