Skip to content

Commit c5fdc93

Browse files
Fix for jsonapi-rb#80
1 parent 8ecab17 commit c5fdc93

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

lib/jsonapi/serializable/resource/conditional_fields.rb

+6-2
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,16 @@ def self.prepended(klass)
2222
end
2323

2424
def self.extended(klass)
25-
klass.class_eval do
26-
include InstanceMethods
25+
klass.module_eval do
26+
prepend InstanceMethods
27+
2728
class << self
2829
attr_accessor :field_condition_blocks
2930
attr_accessor :link_condition_blocks
3031
end
3132
self.field_condition_blocks ||= {}
3233
self.link_condition_blocks ||= {}
34+
3335
end
3436
end
3537

@@ -49,6 +51,8 @@ def attribute(name, options = {}, &block)
4951
_register_condition(field_condition_blocks, name, options)
5052
end
5153

54+
55+
5256
# Handle the `if` and `unless` options for relationships (has_one,
5357
# belongs_to, has_many).
5458
#

0 commit comments

Comments
 (0)