Sha256: 0940ce0cc0176cfc899770d59453c605d5e0eaf1423ce8e7c3b52a09318cc058

Contents?: true

Size: 400 Bytes

Versions: 4

Compression:

Stored size: 400 Bytes

Contents

module Ixtlan
  module Core
    module OptimisticDataMapper

      def self.included(base)
        base.class_eval do
          def optimistic_find(updated_at, *args)
            updated_at = new(:updated_at => updated_at).updated_at
            # TODO make it work with different PKs
            first(:id => args[0], :updated_at => updated_at)
          end
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ixtlan-core-0.6.0 lib/ixtlan/core/optimistic_data_mapper.rb
ixtlan-core-0.5.0 lib/ixtlan/core/optimistic_data_mapper.rb
ixtlan-core-0.4.1 lib/ixtlan/core/optimistic_data_mapper.rb
ixtlan-core-0.4.0 lib/ixtlan/core/optimistic_data_mapper.rb