[Rails] where do you put helper functions for fixture generation?

2010-03-07 Thread fearless_fool
I'm writing a fixture in test/fixtures/parrots_model.yml, and I'm happily using ERB to flesh out my fixture. Suddenly, I realize that I need a helper function to call from my erb code, such as: polly: subtype: parakeet weight_kg: <%= ounces_to_kg(22.3) %> alex: subtype: african gray weig

[Rails] Seeking good examples for Data Warehousing / Dimensional Modeling

2010-02-25 Thread fearless_fool
Group: Are there any good fully-spelled-out examples for Data Warehousing / Dimensional modeling in Rails? (An implementation of one of the chapters from Ralph Kimball's excellent "The Data Warehouse Toolkit would be ideal...) I understand Dimensional Modeling. I understand just enough Rails, b

[Rails] Re: noobish: create migration to add foreign keys with :thro

2010-02-19 Thread fearless_fool
@Marnen: first, apologies on the misspelling -- no slight intended. After thrashing around on this forum and working through AWDwR, I can pose my question more succinctly. But bear with me if I still get it wrong... * You use migrations to define / extend / modify the tables in your db. * Activ

[Rails] Re: noobish: create migration to add foreign keys with :thro

2010-02-18 Thread fearless_fool
@Marmen: Thanks much for the pointers and guidance. (In retrospect, I really could have asked "when is it appropriate to hand-edit a subclass of ActiveRecord?", and the answer, I think is "almost never, for simple cases".) With this new found understanding, Matthew Higgins's Foreigner package m

[Rails] noobish: create migration to add foreign keys with :through attrs?

2010-02-16 Thread fearless_fool
I'm dipping my toe into the world of data warehousing and dimensional databases. In: http://rails.rubyonrails.org/classes/ActiveRecord/Associations/ClassMethods.html I was excited to find the following under the "many to many" section -- it's the pattern I'm looking for: class Assig

[Rails] Re: when does 'dog' not equal 'dog'?

2010-02-10 Thread fearless_fool
> Can't reproduce with what you've given. > > ruby-1.9.1-p376 > class A > ruby-1.9.1-p376 ?>  attr_accessor :slot > ruby-1.9.1-p376 ?>  def matches? s > ruby-1.9.1-p376 ?>    puts "s <=> @slot = #{s <=> @slot}" > ruby-1.9.1-p376 ?>    (s <=> @slot) == 0 > ruby-1.9.1-p376 ?>    end > ruby-1.9.1-p376

[Rails] when does 'dog' not equal 'dog'?

2010-02-10 Thread fearless_fool
This is more a Ruby than a Rails question -- feel free to redirect me as appropriate -- but either this is a Ruby 1.9 bug or I have some serious misunderstanding. Essentially, I've caught the <=> operator returning nil -- not -1, 0, or 1, but nil. Schematically: class A attr_accessor :slot f

[Rails] "Getting Started" needs Rails 3.0, but "gem install rails" installs Rails 2.3.8

2010-02-01 Thread fearless_fool
As of this writing: The Getting Started guide (http://guides.rails.info/ getting_started.html) was recently re-written to reflect recent features in Rails 3.0. But the instructions it gives for downloading rails in section 3.1 ("gem install rails") fetches rails 2.3.8, which won't work for the gi