Skip to content
Browse files

Only undef methods that exist (Ruby 1.9 compatibility)

  • Loading branch information...
1 parent 6778349 commit ad86a8a2497202db00a44b9f4a0f67d7cef91a52 @niels niels committed
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/machinist.rb
View
4 lib/machinist.rb
@@ -31,8 +31,8 @@ def initialize(object, attributes = {})
# Undef a couple of methods that are common ActiveRecord attributes.
# (Both of these are deprecated in Ruby 1.8 anyway.)
- undef_method :id
- undef_method :type
+ undef_method :id if respond_to?(:id)
+ undef_method :type if respond_to?(:type)
def object
yield @object if block_given?

0 comments on commit ad86a8a

Please sign in to comment.
Something went wrong with that request. Please try again.