Skip to content

Instantly share code, notes, and snippets.

@nz
Created September 8, 2009 20:01
Show Gist options
  • Save nz/183181 to your computer and use it in GitHub Desktop.
Save nz/183181 to your computer and use it in GitHub Desktop.
class Thing < ActiveRecord::Base
has_many :other_things, :select => OtherThing.columns_to_select.join(",")
end
class OtherThing < ActiveRecord::Base
belongs_to :thing
def self.columns_to_select
column_names - ["big_column_1", "big_column_2"]
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment