{"record":{"id":"5529db07738f8864","repo":"padrino/padrino-framework","slug":"adapter-orm-is-not-yet-supported","errorCode":null,"errorMessage":"Adapter #{orm} is not yet supported!","messagePattern":"Adapter #(.+?) is not yet supported!","errorType":"exception","errorClass":"Padrino::Admin::Generators::OrmError","httpStatus":null,"severity":"error","filePath":"padrino-admin/lib/padrino-admin/generators/orm.rb","lineNumber":59,"sourceCode":"          when :string                      then :text_field\n          when :text                        then :text_area\n          when :boolean                     then :check_box\n          else :text_field\n          end\n        end\n\n        Column = Struct.new(:name, :type) # for compatibility\n\n        def columns\n          @columns ||=\n            case orm\n            when :activerecord then @klass.columns\n            when :minirecord   then @klass.columns\n            when :mongoid      then @klass.fields.values.reject { |col| %w[_id _type].include?(col.name) }\n            when :sequel       then @klass.db_schema.map { |k, v| v[:type] = :text if v[:db_type] =~ /^text/i; Column.new(k, v[:type]) }\n            when :ohm          then @klass.attributes.map { |a| Column.new(a.to_s, :string) } # ohm has strings\n            when :dynamoid     then @klass.attributes.map { |k, v| Column.new(k.to_s, v[:type]) }\n            else raise OrmError, \"Adapter #{orm} is not yet supported!\"\n            end\n        end\n\n        def column_fields\n          excluded_columns = %w[created_at updated_at] << (orm == :mongoid ? '_id' : 'id')\n          column_fields    = columns.dup\n          column_fields.reject! { |column| excluded_columns.include?(column.name.to_s) }\n          @column_fields ||= column_fields.map do |column|\n            { name: column.name, field_type: field_type(column.type) }\n          end\n        end\n\n        def all\n          \"#{klass_name}.all\"\n        end\n\n        def find(params = nil)\n          case orm","sourceCodeStart":41,"sourceCodeEnd":77,"githubUrl":"https://github.com/padrino/padrino-framework/blob/167044f3d56b2bce12f943eb826fdb0b0ea94375/padrino-admin/lib/padrino-admin/generators/orm.rb#L41-L77","documentation":"Orm#columns introspects schema metadata for the admin page generator via a case over the orm symbol; anything outside activerecord/minirecord/mongoid/sequel/ohm/dynamoid falls through to else and raises OrmError. It fires lazily on first use because @columns memoizes — typically when the generator asks for field metadata during admin_page generation.","triggerScenarios":"Building Padrino::Admin::Generators::Orm.new('Post', :datamapper) (or any unsupported/misspelled symbol) and calling .columns or .column_fields; programmatic reuse of Generators::Orm with a custom adapter string that was symbolized but never validated.","commonSituations":"DataMapper or other legacy adapters after a Padrino upgrade; a typo in the adapter passed by surrounding code (orm is symbolized via to_sym so the typo survives initialize); writing a plugin that reuses Generators::Orm for a new ORM without extending the case list.","solutions":["Use one of the supported adapter symbols: :activerecord, :minirecord, :mongoid, :sequel, :ohm, :dynamoid","Inspect the value passed as orm — initialization does not validate it, so a misspelling only surfaces here","For custom schemas, pass explicit columns/column_fields to Orm.new and avoid #columns, or subclass Orm and override the case"],"exampleFix":"# before\nPadrino::Admin::Generators::Orm.new('Post', :datamapper).columns\n\n# after\nPadrino::Admin::Generators::Orm.new('Post', :activerecord).columns","handlingStrategy":"type-guard","validationCode":"SUPPORTED = %i[activerecord minirecord mongoid sequel ohm dynamoid].freeze\nraise ArgumentError, orm unless SUPPORTED.include?(orm.to_sym)\nPadrino::Admin::Generators::Orm.new('Post', orm).columns","typeGuard":"SUPPORTED_ORMS = %i[activerecord minirecord mongoid sequel ohm dynamoid].freeze\ndef supported_orm?(orm) = SUPPORTED_ORMS.include?(orm.to_sym)","tryCatchPattern":"begin\n  orm_helper.columns\nrescue Padrino::Admin::Generators::OrmError => e\n  abort \"#{e.message} — use one of #{SUPPORTED_ORMS.join('/')}\"\nend","preventionTips":["Validate the adapter symbol at the call site — Orm#initialize does not, so typos surface late","Centralize the supported-orm list in one constant shared by your generator scripts","After upgrading padrino-admin, re-check which adapters the case statements still cover"],"tags":["padrino-admin","generator","orm","adapter","ruby"],"backgroundTag":"unsupported-backend-adapter","analyzedSha":"167044f3d56b2bce12f943eb826fdb0b0ea94375","analyzedAt":"2026-08-23T12:41:41.049Z","schemaVersion":2},"datasetVersion":"2026-08-23T16:17:53.355Z"}