From edcc68a4ed6240039ae084ae94cb3cd6ba2169cc Mon Sep 17 00:00:00 2001 From: Denis Knauf Date: Wed, 30 Nov 2011 13:52:19 +0100 Subject: [PATCH] dependency to methodphitamine removed. --- Rakefile | 1 - lib/smql_to_ar.rb | 4 ++-- lib/smql_to_ar/condition_types.rb | 13 ++++++++----- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/Rakefile b/Rakefile index c9ac2a2..4245ce4 100644 --- a/Rakefile +++ b/Rakefile @@ -15,7 +15,6 @@ begin gem.add_dependency 'activerecord' gem.add_dependency 'activesupport' gem.add_dependency 'json' - gem.add_dependency 'methodphitamine' end Jeweler::GemcutterTasks.new rescue LoadError diff --git a/lib/smql_to_ar.rb b/lib/smql_to_ar.rb index 19ab574..d9404b2 100644 --- a/lib/smql_to_ar.rb +++ b/lib/smql_to_ar.rb @@ -152,10 +152,10 @@ class SmqlToAR @model = model @last_model = nil *@path, @col = *Array.wrap( col). - collect( &it.to_s.split( /[.\/]/)). + collect {|x| x.to_s.split /[.\/]/ }. flatten. collect( &Col.method( :new)). - reject( &it===:self) + reject {|x| x === :self } end def last_model diff --git a/lib/smql_to_ar/condition_types.rb b/lib/smql_to_ar/condition_types.rb index 639c9bf..cf47ccd 100644 --- a/lib/smql_to_ar/condition_types.rb +++ b/lib/smql_to_ar/condition_types.rb @@ -100,7 +100,7 @@ class SmqlToAR # Passt das Object, die Klasse instanzieren. def try_parse model, cols, op, val #p :class => self, :self => name, :try_parse => op, :cols => cols, :with => self::Operator, :value => val, :expected => self::Expected, :model => model.name - new model, cols, val if self::Operator === op and self::Expected.any?( &it === val) + new model, cols, val if self::Operator === op and self::Expected.any? {|x| x === val} end def inspect @@ -225,7 +225,7 @@ class SmqlToAR # { 'articles=>' => [ { id: 1 }, { id: 2 } ] } class EqualJoin