Skip to content

Commit 2f5c1ce

Browse files
committed
Load columns from schema to avoid AR ignored/only column configuration
1 parent 62f522e commit 2f5c1ce

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/annotate_rb/model_annotator/model_wrapper.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,10 @@ def database_name
4444

4545
# Returns the unmodified model columns
4646
def raw_columns
47-
@raw_columns ||= @klass.columns
47+
@raw_columns ||= begin
48+
@klass.load_schema
49+
@klass.schema_cache.columns_hash(@klass.table_name).values.freeze
50+
end
4851
end
4952

5053
def primary_key

0 commit comments

Comments
 (0)