module Ixtlan module Core module OptimisticActiveRecord def self.included(base) base.class_eval do def self.optimistic_find(updated_at, *args) p updated_at updated_at = new(:updated_at => updated_at).updated_at # TODO make it work with different PKs r = first(:conditions => ["id = ? and updated_at = ?", args[0], updated_at]) p args[0] p updated_at p r r end end end end end end