Displaying 1 result from an estimated 1 matches for "find_by_content_id".
Did you mean:
find_by_contents_id
2006 Jul 06
1
ActiveRecord::find or Enumerable::find
...nd Enumerable::find (or detect since ActiveRecord
redefines the find method) for a has_many association?
Here is an example:
I have a list that has 10 lines and I want to find the first blank line.
Which approach would be better?
list.lines.detect { |line| line.content == nil }
or
list.lines.find_by_content_id(nil)
I appreciate any insight you can provide.
Chris
--
Posted via http://www.ruby-forum.com/.