Add "scope" method

This commit is contained in:
twinturbo
2012-07-14 14:54:23 +02:00
parent 3e87c6414d
commit 7936e3efba
3 changed files with 13 additions and 3 deletions

View File

@@ -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.