We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 3a30d2f + f5433f9 commit 17c14baCopy full SHA for 17c14ba
1 file changed
lib/jsonapi/association.rb
@@ -19,7 +19,7 @@ def initialize(name, options={})
19
super
20
@class_name = options.fetch(:class_name, name.to_s.capitalize)
21
@type = class_name.underscore.pluralize.to_sym
22
- @foreign_key ||= @key.nil? ? "#{name}_id".to_sym : @key
+ @foreign_key ||= "#{name}_id".to_sym
23
end
24
25
@@ -28,7 +28,7 @@ def initialize(name, options={})
28
29
@class_name = options.fetch(:class_name, name.to_s.capitalize.singularize)
30
31
- @foreign_key ||= @key.nil? ? "#{name.to_s.singularize}_ids".to_sym : @key
+ @foreign_key ||= "#{name.to_s.singularize}_ids".to_sym
32
33
34
0 commit comments