>Which tests are failing? Are any tests now passing that were failing,
or vice versa?
I've not done any tests before or since, I got a bit carried away before
I got to the chapter on tests in my book (is that bad of me?). I'm
literally just trying to use the site and picking out errors by hand,
this one is quite obvious as being able to save a Loan basically the
whole point of my site!
> You've probably missed something: your stack trace still seems to
involve Rails' transaction code
If I do a project wide case-insensitive search on all files within the
appname directory created by "rails appname", the only instance of
'transaction' is found in this file:
test_helper.rb
self.use_transactional_fixtures = true
I left this alone because I didn't really understand what it was.
> Can we see your current LoansController code for new and create?
def new
@loan = Loan.new
end
def create
@loan = Loan.new(params[:loan])
if @loan.save <<< line 36 (this is not in my code, I just put it
here)
flash[:notice] = "Successfully created loan."
redirect_to items_path
else
render :action => 'new'
end
end
> The model definition would probably help as well.
class Loan < ActiveRecord::Base
#attr_accessible :item_id, :user_id, :from, :to, :status
belongs_to :item
belongs_to :user
def owner
@item = Item.find(item_id)
User.find(@item.user_id)
end
def borrower
User.find(user_id)
end
end
-- ends
Thanks again for your time on this, I am the only person I know using
Ruby and/or Rails, I would be totally adrift without you guys.
Sam
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: 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/rubyonrails-talk?hl=en.