drwl / annotaterb

A Ruby Gem that adds annotations to your Rails models and route files.
Other
208 stars 20 forks source link

Feature Request: add support for arrays when using StoreModel #125

Closed Z2Flow closed 5 months ago

Z2Flow commented 5 months ago

If I use StoreModel and in a class use the array: true for an attribute that is a jsonb column:

class Person < ApplicationRecord
  include StoreModel::Model

  class Characteristics
    include StoreModel::Model

    attribute :height, :integer
    attribute :weight, :integer
    attribute :hobbies, :string, array: true
  end

  attribute :characteristics, Characteristics.to_type
end

The following error occurs:

Unable to process app/models/person.rb: unknown keyword: :array
Model files unchanged.

Versions

Z2Flow commented 5 months ago

My mistake: the problem is StoreModel.