Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ## Setup
- class Address
- attr_accessor :id, :created_at, :line_one, :updated_at, :line_two, :tag
- end
- exclude = %w(id created_at updated_at tag)
- a = Address
- # Assign some attrs
- b = Address
- # Assign some attrs
- ## Problem
- a.attributes.except(exclude) == b.attributes.except(exclude)
- # Because Except takes a splat, it's not smart enough to ... join, the array
- # into a comma separated list of args?
- def except(*vals)
- ..... something about a hash.reject ;)
- end
Add Comment
Please, Sign In to add comment