Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for #80 #81

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions lib/jsonapi/serializable/resource/conditional_fields.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,16 @@ def self.prepended(klass)
end

def self.extended(klass)
klass.class_eval do
include InstanceMethods
klass.module_eval do
prepend InstanceMethods

class << self
attr_accessor :field_condition_blocks
attr_accessor :link_condition_blocks
end
self.field_condition_blocks ||= {}
self.link_condition_blocks ||= {}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extra empty line detected at block body end.

end
end

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


Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extra blank line detected.


Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extra blank line detected.

# Handle the `if` and `unless` options for relationships (has_one,
# belongs_to, has_many).
#
Expand Down