DEV Community

Discussion on: Wrapping JSON-based ActiveRecord attributes with classes

Collapse
 
dmitrytsepelev profile image
Dmitry Tsepelev

It was impossible earlier but I've just released 0.2.0 which supports this behavior:

class Product < ApplicationRecord
  attribute :configurations, Configuration.to_array_type
end
Enter fullscreen mode Exit fullscreen mode

Thanks for the idea!