Whoops, I am not following you 100% here (This is what I get for copoy /
pasting / mangling a function without fully understanding it
I don’t think I gave you the full story either. def self.clientref(
reference ) is in another class which doesn’t hold the full client name.
I’ll give you the full source.
class Bugclientref < ActiveRecord::Base
set_primary_key “bug_id”
class Bugclient < ActiveRecord::Base
set_primary_key “bc_ref”
def self.fullname( reference )
result = Bugclient.find(reference.strip)
result.bc_name
end
end
So the collect SHOULD be trying to get the fullname from Bugclient based
on the reference in Bugclientref and adding it to the Reference from
Bugclientref.
Does this make sense? It hurts my head thinking about it. I want to kill
the guy who came up with this schema.
It looks like you’re using a class method when you actually want a
end
reference ) is in another class which doesn’t hold the full client
{|b| [ b.bc_name.strip << " - " << b.client_ref.strip ]}
result.bc_name
Does this make sense? It hurts my head thinking about it. I want to
kill
the guy who came up with this schema.
Don’t you love newbies?
Thanks
Jeff
What kind of errors are you getting? Is it possible that some of the
"b.client_id.strip"s that you’re passing in don’t exist in the
Bugclient table? Maybe you’re doing it right, but the state of the
database integrity just isn’t what you’re expecting.
It looks like you’re using a class method when you actually want a
end
reference ) is in another class which doesn’t hold the full client
{|b| [ b.bc_name.strip << " - " << b.client_ref.strip ]}
result.bc_name
Does this make sense? It hurts my head thinking about it. I want to
kill
the guy who came up with this schema.
Don’t you love newbies?
Thanks
Jeff
What kind of errors are you getting? Is it possible that some of the
"b.client_id.strip"s that you’re passing in don’t exist in the
Bugclient table? Maybe you’re doing it right, but the state of the
database integrity just isn’t what you’re expecting.