#2 Dynamic find_by Methods

Shorten simple finds considerably and improve readability by using the dynamic find_all_by and find_by methods.
# tasks_controller.rb
def incomplete
  @tasks = Task.find_all_by_complete(false)
end

def last_incomplete
  @task = Task.find_by_complete(false, :order => 'created_at DESC')
end

你可能感兴趣的:(java)