Sam Ward wrote:
> Colin Law wrote:
>> On 4 August 2010 18:44, Sam Ward <[email protected]> wrote:
>>
> words starting with Tra...)
>> 
>> Colin
> 
> Oh no!  Wow, it's going to be fun to unpick all that... transaction is 
> probably the most used word in my entire project!
> 
> Thanks Colin, at least I can direct my efforts into fixing it rather 
> than pulling my hair out.  You're a life saver.
> 
> 
> Sam
> 
> 
> ...and here was me hoping someone would say "you have the wrong brackets 
> on line 12"...

There is one other alternative, and I hesitate to mention it because 
you're still asking for long-term maintenance issues (i.e., Marnen and 
Colin have the right of it - change your code)...

but you *can* preface your Transaction model references with '::' 
whenever utilizing a method from your Transaction class, such as:

  def new
    @transaction = ::Transaction.new
  end

  def create
    @transaction = ::Transaction.new(params[:transaction])
    if @transaction.save
      flash[:notice] = "Successfully created transaction."
      redirect_to items_path
    else
      render :action => 'new'
    end
  end
-- 
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.

Reply via email to