Model.create ?

I have two models (Transaction and RentedItem).

  has_many :rented_items
  has_many :inventories, :through => :rented_items

  def add(inventory_id)
    items = rented_items.find_all_by_inventory_id(inventory_id)
    inventory = Inventory.find(inventory_id)
    if items.size < 1
      ri = rented_items.create(:inventory_id =>,
                               :amount => 1,
                               :price => inventory.price)
      ri = items.first
      ri.update_attribute(:amount, ri.amount + 1)


def add
    @inventory = Inventory.find(params[:id])
    @item = @transaction.add( <= where @transaction is set
in a before_filter
    flash[:notice] = "Added <em>#{}</em>"
    redirect_to :controller => "inventory", :action => "list"

I dont receive any errors and when list in rendered I see the correct
flash[:notice]. In the add method inside Transaction.rb the object is
created and return but when I look in the database no record was saved.
I am completely lost on why the record wont save but is being created.

***I even tried RentedItem.create(...) in the controller to remove all
confusion from the controller to model ... and it still wont work.***

Could someone point me in any direction? Thanks

Having an association called transaction is a bad idea as the accessor
methods generated will overwrite the transaction method (which is used
when saving)


I was just in the middle of renaming everything and creating new models
to see if it would help. Good to know I am already on the right track.

Thanks a lot,