Browse files

Added a join parameter as the third argument to Base.find_first #426

…[skaes@web.de]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1047 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent 8499c24 commit e130b9e01784ac8c5d4743fa121a9d5e3618e151 @dhh dhh committed Mar 31, 2005
Showing with 4 additions and 2 deletions.
  1. +2 −0 activerecord/CHANGELOG
  2. +2 −2 activerecord/lib/active_record/base.rb
View
2 activerecord/CHANGELOG
@@ -1,5 +1,7 @@
*SVN*
+* Added a join parameter as the third argument to Base.find_first #426 [skaes@web.de]
+
* Fixed bug in Base#hash method that would treat records with the same string-based id as different [Dave Thomas]
* Renamed DateHelper#distance_of_time_in_words_to_now to DateHelper#time_ago_in_words (old method name is still available as a deprecated alias)
View
4 activerecord/lib/active_record/base.rb
@@ -384,8 +384,8 @@ def find_by_sql(sql)
# be used to create the object. In such cases, it might be beneficial to also specify
# +orderings+, like "income DESC, name", to control exactly which record is to be used. Example:
# Employee.find_first "income > 50000", "income DESC, name"
- def find_first(conditions = nil, orderings = nil)
- find_all(conditions, orderings, 1).first
+ def find_first(conditions = nil, orderings = nil, joins = nil)
+ find_all(conditions, orderings, 1, joins).first
end
# Creates an object, instantly saves it as a record (if the validation permits it), and returns it. If the save

0 comments on commit e130b9e

Please sign in to comment.