We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent df946c1 commit b079dd2Copy full SHA for b079dd2
2 files changed
lib/polymorphic_integer_type/extensions.rb
@@ -82,6 +82,14 @@ def [](value)
82
end
83
84
85
+ def []=(attr_name, value)
86
+ if _polymorphic_foreign_types.include?(attr_name)
87
+ send("#{attr_name}=", value)
88
+ else
89
+ super(attr_name, value)
90
+ end
91
92
+
93
94
95
spec/polymorphic_integer_type_spec.rb
@@ -37,6 +37,14 @@
37
let(:link) { source.source_links.create }
38
let(:source) { cat }
39
include_examples "proper source"
40
41
+ context "and the link is accessed through the associations" do
42
+ before { link }
43
44
+ it "should have the proper source" do
45
+ expect(source.source_links[0].source).to eql source
46
47
48
49
50
context "When a link is given polymorphic record" do
0 commit comments