+ Start a Discussion
SyracuseSnowSyracuseSnow 

Ruby (ActiveSalesforce) Custom object question


I am trying to ASF (v1.1.6) to retrieve data between the Opportunity standard object and Bag custom object, but I am having some problems. I am getting the following error message of

"Column not found for JXUTESTII__Opportunity__c!"

C:/Ruby/InstantRails/ruby/lib/ruby/gems/1.8/gems/activesalesforce-1.1.6/lib/asf_adapter.rb:312:in `select_all'
C:/Ruby/InstantRails/ruby/lib/ruby/gems/1.8/gems/activesalesforce-1.1.6/lib/asf_adapter.rb:307:in `gsub!'
C:/Ruby/InstantRails/ruby/lib/ruby/gems/1.8/gems/activesalesforce-1.1.6/lib/asf_adapter.rb:307:in `select_all'
C:/Ruby/InstantRails/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/base.rb:427:in `find_by_sql'
C:/Ruby/InstantRails/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/base.rb:997:in `find_every'
C:/Ruby/InstantRails/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/base.rb:418:in `find'
C:/Ruby/InstantRails/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/associations/has_many_association.rb:91:in `find'
C:/Ruby/InstantRails/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/associations/association_collection.rb:159:in `find_target'
C:/Ruby/InstantRails/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/associations/has_many_association.rb:123:in `load_target'
C:/Ruby/InstantRails/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/associations/association_proxy.rb:122:in `method_missing'
C:/Ruby/InstantRails/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/associations/has_many_association.rb:98:in `method_missing'
#{RAILS_ROOT}/app/views/opportunities/show.rhtml:7:in `_run_rhtml_47app47views47opportunities47show46rhtml'

I have two objects:
Opportunity: Standard object
Bag: custom object which uses JXUTESTII__Opportunity__c field to look up to the opportunity.

opportunity.rb
class Opportunity < ActiveRecord::Base
has_many :bags,
:class_name => 'Bag',
:foreign_key => 'JXUTESTII__Opportunity__c'
end

bag.rb
class Bag < ActiveRecord::Base
include ActiveSalesforce::ActiveRecord::Mixin
set_table_name 'JXUTESTII__Bag__c'

belongs_to :opportunity,
:class_name => 'Opportunity',
:foreign_key => 'JXUTESTII__Opportunity__c'
end


the code that gives the error message:
<% for bag in @opportunity.bags %>
<p><%= bag.id %></p>
<% end %>


Any help will be greatly appreciated.
RupRup

SyracuseSnow wrote:

[snip]

"Column not found for JXUTESTII__Opportunity__c!"

[snip]




ActiveSalesforce does not support namespace prefixes, such as JXUTESTII used here.

See http://community.salesforce.com/sforce/board/message?board.id=PerlDevelopment&message.id=2140