rhomobile/rhoconnect-rb — Issue #1: Readme incorrect?
Author: omricohen
Created: 2011-10-14 01:43:04+00:00
State: open

Shoudlnt the following code

class Product < ActiveRecord::Base
include Rhoconnect::Resource

belongs_to :user

def partition
lambda { self.user.username }
end

def self.rhoconnect_query(partition)
Product.where(:user_id => partition)
end
end

Actually be

class Product < ActiveRecord::Base
include Rhoconnect::Resource

belongs_to :user

def partition
lambda { self.user.username }
end

def self.rhoconnect_query(partition)
Product.includes(:user).where("users.username = ?",partition)
end
end