Displaying 5 results from an estimated 5 matches for "code_name".
Did you mean:
node_name
2008 Dec 23
1
aggregate / tranpose data
Dear R-Users,
Suppose I have data in the following format:
CODE_NAME ZIP_CODE
John 12345
John 23456
John 34567
Jane 13242
Jane 22123
I want to transpose / convert it into:
CODE_NAME ZIP_CODE
John 12345,23456,34567
Jane 13242,22123
Any...
2010 Aug 19
1
Composite primary keys and :joins=>
...ol and I cannot alter this db
Table-B: # each row has only the code as a foreign_key, the type_key
is hard-coded to "FOOKEY"
an_id, code, ...
Models:
class TableB < AR::Base
set_table_name ''table_b''
set_primary_key :an_id # singular PK
belongs_to :code_name, :class_name=>''TableA'', :primary_key=>:pk_code_name, :foreign_key=>:code
SELECT = "*, table_a.name AS pk_name"
def self.get_all
all(:select=>SELECT, :joins=>:code_name)
end
end
class TableA < AR::Base
set_table_name ...
2006 Jun 16
0
Getting error on a group select
Hi,
I''m very new with Ruby and Rails. I have read Agile Web Development
with Rails and was trying to create a grouped selection list by
following his example on page 359.
My helper looks like this:
module LoginHelper
AssocOption = Struct.new(:code_name, :display_name)
class AssocType
attr_reader :type_name, :options
def initialize(name)
@type_name = name
@options = []
end
def <<(option)
@options << option
end
end
none = AssocType.new("NONE")
none << AssocOption.new(&quo...
2006 Jun 16
0
Getting an error on options_groups_from_collection_for_select
Hi,
I''m very new with Ruby and Rails. I have read Agile Web Development
with Rails and was trying to create a grouped selection list by
following his example on page 359.
My helper looks like this:
module LoginHelper
AssocOption = Struct.new(:code_name, :display_name)
class AssocType
attr_reader :type_name, :options
def initialize(name)
@type_name = name
@options = []
end
def <<(option)
@options << option
end
end
none = AssocType.new("NONE")
none << AssocOption.new(&quo...
2007 Nov 07
5
Unexplainable failure...at least for me
I have an address model with country_id and province_id fields
There is also a full_address method that returns an address that is in a
format that the google maps api will be able to return a long-lat
coords.
Within the full_address method there is a call to obtain the
province/state and country name.
---------
def full_address
...
full_address = [city, self.province.name,