mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-25 15:23:06 +00:00
Add "scope" method
This commit is contained in:
@@ -103,7 +103,7 @@ module ActiveModel
|
||||
# end
|
||||
#
|
||||
# def author?
|
||||
# post.author == options[:scope]
|
||||
# post.author == scope
|
||||
# end
|
||||
# end
|
||||
#
|
||||
@@ -520,6 +520,11 @@ module ActiveModel
|
||||
hash
|
||||
end
|
||||
|
||||
# Returns options[:scope]
|
||||
def scope
|
||||
@options[:scope]
|
||||
end
|
||||
|
||||
alias :read_attribute_for_serialization :send
|
||||
|
||||
# Use ActiveSupport::Notifications to send events to external systems.
|
||||
|
||||
Reference in New Issue
Block a user