access properties of current model in has_many declaration
- by seth.vargo
Hello, I didn't exactly know how to pose this question other than through example...
I have a class we will call Foo. Foo :has_many Bar. Foo has a boolean attribute called randomize that determines the order of the the Bars in the :has_many relationship:
class CreateFoo < ActiveRecord::Migration
def self.up
create_table :foos do |t|
…