From 8fa44de76ba4fb71bbe46900c8de27e73d0acfd1 Mon Sep 17 00:00:00 2001 From: Reid Morrison Date: Wed, 22 Aug 2012 14:26:59 -0400 Subject: [PATCH] Support Ruby 1.9 --- Rakefile | 1 + lib/symmetric_encryption/extensions/active_record/base.rb | 2 +- lib/symmetric_encryption/version.rb | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Rakefile b/Rakefile index aba79b4..263006b 100644 --- a/Rakefile +++ b/Rakefile @@ -1,6 +1,7 @@ lib = File.expand_path('../lib/', __FILE__) $:.unshift lib unless $:.include?(lib) +require 'rubygems' require 'rake/clean' require 'rake/testtask' require 'date' diff --git a/lib/symmetric_encryption/extensions/active_record/base.rb b/lib/symmetric_encryption/extensions/active_record/base.rb index 22e114d..0a4aaf0 100644 --- a/lib/symmetric_encryption/extensions/active_record/base.rb +++ b/lib/symmetric_encryption/extensions/active_record/base.rb @@ -128,7 +128,7 @@ def method_missing_with_attr_encrypted(method, *args, &block) attribute_names = match.captures.last.split('_and_') attribute_names.each_with_index do |attribute, index| encrypted_name = "encrypted_#{attribute}" - if instance_methods.include? encrypted_name #.to_sym in 1.9 + if method_defined? encrypted_name.to_sym args[index] = ::SymmetricEncryption.encrypt(args[index]) attribute_names[index] = encrypted_name end diff --git a/lib/symmetric_encryption/version.rb b/lib/symmetric_encryption/version.rb index 64b560a..dec5173 100644 --- a/lib/symmetric_encryption/version.rb +++ b/lib/symmetric_encryption/version.rb @@ -1,4 +1,4 @@ # encoding: utf-8 module SymmetricEncryption #:nodoc - VERSION = "0.7.1" + VERSION = "0.7.2" end