1
2
3
4
# Associations
#
# User: has_many :sources, :as => :sourceable, :dependent => :destroy
...

Ruby Get child elements from a o...

by Chris, March 11, 2010 08:27, No refactoring, tagged with model, assoziations, activerecord, rails activerecord

For a object (e.g. user), I...

5d7c8b8f2de06c07b2bf0848d20ce71f Talk
1
2
3
4
class Asset < ActiveRecord::Base
	belongs_to :account
	belongs_to :asset_type
...

Ruby Advanced search form & ...

by Erez Ben Shoham, March 16, 2009 11:33, 3 refactorings, tagged with named_scope, search, form, model

I have an Asset model in a ...

30bcacccb1c7fa2b577b905a2128027f Talk
1
2
3
4
describe Stock do

  it "should be valid when new" do
...

Ruby repeated code in rspec mode...

by scottmotte.myopenid.com, November 15, 2008 08:51, No refactoring, tagged with rspec, merb, model

how do i clean up this repe...

2fb54bca5a55a7a16f8f9c20c05ce7c2 Talk
1
2
3
4
class Newalert 

def new_alert_validations(params)
...

Ruby model validations

by DG, June 17, 2008 05:51, 4 refactorings, tagged with model, validations

Following is the big(easy t...

51224bdd17878b3b19e8987e9bb336a2 Talk
1
2
3
class Race < ActiveRecord::Base
  
...

Ruby Help generating abbreviatio...

by Michael Filbin, April 06, 2008 16:16, 3 refactorings, tagged with abbreviation, string, model, attribute

Hi all,

I am attempting ...

14b8667b3bdf64068647b96c26001e0d Talk
1
2
3
4
class FormMailer < ActionMailer::Base

  def contact_us(params)
...

Ruby Action Mailer - It has to b...

by phill, March 01, 2008 19:19, 4 refactorings, tagged with ActionMailer, model, dry form

Here is a FormMailer that I...

B4cf145acfab95d0a6926b988f93b4b8 Talk
1
2
3
4
def which_class?
  if self.language == "C/C++"
     self.language = "sh_cpp"
...

Ruby class picker

by Garrett, December 10, 2007 00:04, 8 refactorings, tagged with ruby, rails, activerecord, model

language is a column in a c...

E9674d02c33d1d711a462026f40bbaf4 Talk