Skip to content

Commit

Permalink
rhom: fix issue with find
Browse files Browse the repository at this point in the history
  • Loading branch information
genywind committed Aug 24, 2011
1 parent a4823ad commit 18039ae
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/framework/rhom/rhom_object_factory.rb
Expand Up @@ -907,8 +907,8 @@ def find(*args, &block)
#it is more effective to use old find here
if attribs && attribs != '*' && attribs.length() != 0 && !args[1][:dont_ignore_missed_attribs]
sql << "SELECT object FROM object_values WHERE attrib=? AND source_id=?"
values << nSrcID
values << attribs[0]
values << nSrcID
else
if limit == 1 && offset == 0
sql = "SELECT object FROM object_values WHERE source_id=?"
Expand Down
8 changes: 8 additions & 0 deletions spec/phone_spec/app/spec/rhom_object_spec.rb
Expand Up @@ -1237,6 +1237,14 @@ def after_all
end
end

it "should include only selected column without order" do
@accts = getAccount.find(:all, :select => ['name'] )

@accts[0].name.should == "Aeroprise"
@accts[0].industry.should be_nil
@accts[0].vars.length.should == 3
end

it "should include only selected column" do
@accts = getAccount.find(:all, :select => ['name'], :order => 'name', :orderdir => 'DESC' )

Expand Down

0 comments on commit 18039ae

Please sign in to comment.