Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
yuzisee committed Feb 3, 2025
1 parent 1fa11ce commit 87d48f0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/rbs_rails/active_record.rb
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,8 @@ def authenticate_#{attribute}: (String) -> (#{klass_name} | false)
mod_sig = +"module GeneratedAttributeMethods\n"
mod_sig << klass.columns.map do |col|
col_serializer = klass.attribute_types[col.name].try(:coder)
puts 'Checking... ' + col.name.to_s
puts ' → found ' + col_serializer.inspect
# e.g. ActiveRecord::Coders::JSON
# if your model has `serialize ..., JSON`
# e.g. #<ActiveRecord::Coders::YAMLColumn:0x0000aaaafdc54970 @attr_name=..., @object_class=Array>
Expand All @@ -515,6 +517,7 @@ def authenticate_#{attribute}: (String) -> (#{klass_name} | false)
sql_type_to_class(col.type)
end
end
puts '[chose ' + class_name + ']'
class_name_opt = optional(class_name)
# If the DB says the column can be null, we need `<type>?`
# ...but if the type is already `untyped` there's no point in writing `untyped?`
Expand Down

0 comments on commit 87d48f0

Please sign in to comment.