search for: middle_nam

Displaying 7 results from an estimated 7 matches for "middle_nam".

Did you mean: middle_num
2006 Nov 17
4
set empty values as null in the database
Le''s say that I have a table called people and the column middle_name is nullable. If the user enters say blank or empty space then in the database it is recorded as empty space. I would like in all my models all empty spaces to be recorded as null. I guess I can write a plugin which will do so for all the models but I''m sure something like that should alr...
2009 Jan 13
1
ROR - Excel Export Example
...;a" + line_count.to_s.strip )[''Value''] = contact.first_name.to_s excel.Range("b" + line_count.to_s.strip )[''Value''] = contact.last_name.to_s excel.Range("c" + line_count.to_s.strip )[''Value''] = contact.middle_name.to_s excel.Range("d" + line_count.to_s.strip )[''Value''] = (contact.first_name.to_s + " " + contact.middle_name.to_s + " " + contact.last_name.to_s).strip end # Here are some common file formats: xlCSV=6 xlCSVMac=22 x...
2006 Jan 04
5
habtm recusive
I have a people table: CREATE TABLE people ( id int(10) unsigned NOT NULL auto_increment, first_name varchar(75) default NULL, middle_name varchar(75) default NULL, last_name varchar(75) default NULL, PRIMARY KEY (id) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1272 ; and a people_people table: CREATE TABLE people_people ( person_id int(11) unsigned NOT NULL, person2_id int(11) unsigned NOT NULL, PRIMARY KEY...
2005 Dec 16
4
Validation with Aggregation
ActiveRecord supports composed_of for value objects which is fantastic but one thing that it doesn''t seem to support (or at least I am unable to find any documentation for) validation of the value objects. For example, given the following: class Message < ActiveRecord::Base composed_of :sender, :class_name => ''EmailAddress'' composed_of :recipient,
2008 Nov 01
2
stuck on a validates_presence_of unless issue
...y, :state, :postal_code unless :address_blank? address_blank? checks whether all of the address fields are blank. If I run a test like this, it works: describe "given attributes" do before(:each) do @valid_attributes = { :first_name => "Jonny", :middle_name => "D", :last_name => "Miller", :street_address => "123 This Street", :street_address2 => "Suite 200", :city => "Baltimore", :state => "MD", :postal_code => "23993&...
2007 Oct 16
11
how to arrange the field in excel by using to_csv
Hi all, i am exporting the file by using to_csv, but its coming as unordered rather than my expected output, if i check in the database, its working fine, but in the excel sheet it shows in the unordered,so please let me knoe, how to show orderly in the excel sheet by using to_csv. @report_data=EdiaUserContact.find_by_sql( "SELECT '''' as ''Title'',
2006 Jan 25
12
DRY in Models
I am building an app right now that needs to grant access to three levels of members right now - each will have their own table in the DB. When creating the add_user action I am converting the password into a hashed password through the model. The way I am doing this right now, I will inevitably end up with repeated code in three different models. Is there a way I can define this code in