lib/pupper/api_associations.rb in pupper-0.1.1 vs lib/pupper/api_associations.rb in pupper-0.1.2
- old
+ new
@@ -36,10 +36,10 @@
self.class.attr_accessor(name)
return unless foreign_key.present?
excluded_attrs << name if foreign_key.present?
- send("#{name}_#{foreign_key}=", value)
+ send("#{name}#{foreign_key.prepend('_')}=", value)
end
def find_assoc_type(name)
associations
.find { |(_, assoc)| assoc.include?(name) }&.first