Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Only undef methods that exist (Ruby 1.9 compatibility)

  • Loading branch information...
commit ad86a8a2497202db00a44b9f4a0f67d7cef91a52 1 parent 6778349
@Nielsomat Nielsomat authored
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?
Please sign in to comment.
Something went wrong with that request. Please try again.