Permalink
Browse files

Don't require serializable_hash to take options.

  • Loading branch information...
1 parent f583654 commit e407dfb9bf6ee3b12d699511ef05e6f260c5edf1 @wycats wycats committed Sep 27, 2011
Showing with 3 additions and 3 deletions.
  1. +1 −1 activemodel/lib/active_model/serializer.rb
  2. +2 −2 activemodel/test/cases/serializer_test.rb
@@ -29,7 +29,7 @@ def as_json(*)
serializable_hash
end
- def serializable_hash(*)
+ def serializable_hash
attributes
end
@@ -21,15 +21,15 @@ class UserSerializer < ActiveModel::Serializer
class User2Serializer < ActiveModel::Serializer
attributes :first_name, :last_name
- def serializable_hash(*)
+ def serializable_hash
attributes.merge(:ok => true).merge(scope)
end
end
class MyUserSerializer < ActiveModel::Serializer
attributes :first_name, :last_name
- def serializable_hash(*)
+ def serializable_hash
hash = attributes
hash = hash.merge(:super_user => true) if my_user.super_user?
hash

0 comments on commit e407dfb

Please sign in to comment.