« New App on the Way - CA-Track | Main | Twitter »

Sunday, March 15, 2009

IA Controls

Here is my basic ActiveRecord Control Code, it is just a basic rails generated with little modification
the major parts of the app i am heavily changing.

<pre>

class Controls < ActiveRecord::Base

belongs_to :controls_lists

def self.find_control_all

find(:all, :order => "control")

end

end

class Controls_Lists < ActiveRecord::Base

def item

@item = ControlsLists.find_by_sql("

select * from iacontrols iac

join controls c

order by ControlName

where c.id = 'iac.id'")

end

end

</pre>

Posted by David Jobes at 6:56.33
Categories: Code