search for: other_id

Displaying 3 results from an estimated 3 matches for "other_id".

Did you mean: other_cid
2009 Oct 11
1
passing model data to a plugin called within that model
...which extends ActiveRecord::Base I have the plugin working in my models in other aspects. I would like to pass in some data to the plugin, but I can''t get the data I would like. so if I have: class Stuff < ActiveRecord::Base belongs_to :thing my_plugin :id => self.thing.other_id end it chokes on figuring out what to do with self.thing.other_id. I checked, and self isn''t recognized at the point that I am calling my_plugin so if i do : class Stuff < ActiveRecord::Base belongs_to :thing my_plugin :id => self.class.to_s end when I print out :id...
2006 Jul 17
4
Inner SELECT-s in Rails
Is there a proper way of doing inner selects in rails. Basically, I run in issues where I need the count of a query and end up using find_by_sql. I was wondering if there was any elegant way of doing such queries. Roland -- Posted via http://www.ruby-forum.com/.
2005 Dec 19
0
has_one mapping with arbitrary right and left hand side keys
I have two tables: table_1: tab1_id, other_id table_2: id, tab2_id, something_else I would like to specify a has_one mapping from table_1 to table_2 but specifying that the join is based on (table_2.tab2_id = table_1.other_id). I am half way there with: class Table1 < ActiveRecord::Base set_table_name "table_1" set_primary...