File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed
Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -67,7 +67,11 @@ def anchor_attributes_properties(included_fields:)
6767 model_method = options [ :delegate ] || attr
6868 resource_method = attr
6969
70- model_method_defined = _model_class . try ( :method_defined? , model_method . to_sym )
70+ model_method_defined = _model_class . try (
71+ :method_defined? ,
72+ model_method . to_sym ,
73+ ) && !_model_class . instance_method ( model_method . to_sym )
74+ . owner . is_a? ( ActiveRecord ::AttributeMethods ::GeneratedAttributeMethods )
7175 resource_method_defined = @anchor_method_added_count [ resource_method . to_sym ] > 1
7276 serializer_defined = ( _model_class . try ( :attribute_types ) || { } ) [ model_method . to_s ] . respond_to? ( :coder )
7377 method_defined = model_method_defined || resource_method_defined || serializer_defined
Original file line number Diff line number Diff line change 44RSpec . describe "Example" do
55 def self . snapshot_test ( filename , generate )
66 it "generates correct #{ filename } schema" do
7+ User . find_or_create_by! ( name : "User" , role : :admin ) # allows ActiveRecord to define instance methods for columns
8+
79 schema = generate . call
810 path = Rails . root . join ( "test/files" , filename )
911 unless File . file? ( path )
You can’t perform that action at this time.
0 commit comments