I'm looking through some of the core Sequel code, and I found this little thing:
def primary_key_lookup(pk)
if t = simple_table and p = simple_pk
with_sql("SELECT * FROM #{t} WHERE #{p} =
#{dataset.literal(pk)}").first
else
dataset[primary_key_hash(pk)]
end
end
I don't understand why there are assignments to 't' and 'p'. Why doesn't this
method look like
def primary_key_lookup(pk)
if simple_table and simple_pk
with_sql("SELECT * FROM #{simple_table} WHERE #{simple_pk} =
#{dataset.literal(pk)}").first
else
dataset[primary_key_hash(pk)]
end
end
Is this just some mildly unnecessary bits of code, or is there something going
on here that I'm totally missing?
--
You received this message because you are subscribed to the Google Groups
"sequel-talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sequel-talk?hl=en.