similar to: Re: validates_uniqueness_of question

Displaying 20 results from an estimated 120 matches similar to: "Re: validates_uniqueness_of question"

2012 Nov 21
1
lists as matrix cells ?
Dear R experts, since more or less half a year I am using R. In many of my computations I construct huge matrices. Often I do so using 'cbind' on named lists: do.call( 'cbind', list( "Column_A"=list("Row_one"=1.0, "Row_two"=2.0, "Row_three"=3.0), "Column_B"=list("Row_one"=4.0, "Row_two"=5.0,
2005 Mar 21
1
working with tables
Hi, two questions - I think simple to solve for you ... (1) I've written a function containing some loops. Each loop will generate a few outputs. Finally I have to combine them to get something like a "spreadsheet" that my colleagues can import in EXCEL. Up to now I'm doing it as follows: With each loop-step I assign new values for each "column" of my desired output
2006 Aug 10
2
validates_uniqueness_of problem
hi Could I check to strings for uniqueness together and not individually? That means for me in an example: name: sex: result: ----- ---- ------- miller m unique miller f unique jackson m unique miller m isn''t unique So I want to check the name and sex be together unique. The name isn''t
2006 Jul 28
0
Dreamhost, fastcgi, validates_uniqueness_of.... is not always unique?
Hey everyone, I have an application running on dreamhost with fast cgi (FCGI). I have a model, "Member", that has the following validation: validates_uniqueness_of :email, :if => Proc.new{|member| !member.email.blank?} The :if clause is really not needed because an email address is required and in fact the model also has: validates_presence_of :email
2006 Jun 07
3
validates_uniqueness_of two fields
Is it possible to do a validates_uniqueness_of :name, :zip but only in that context? I''d like to be able to have that zip used again, but not in conjunction with a name already with that zip. Does that make sense? -- Posted via http://www.ruby-forum.com/.
2006 May 10
1
Validates_uniqueness_of multiple field combo?
Hello, I am new to Ruby on rails and this is therefore probably trivial. Lets say I have 3 tables - users[id,name, age, ...], interests[id,name,description, ...], and finally a table user_interests[id,user_id,interest_id] to link a user to a set of interests. Now there is no problem to put validates_uniqueness_of :name in the user-model to ensure that I only have one Lenny, but how do I
2006 May 18
1
validates_uniqueness_of
I used validates_uniqueness_of it is case insensitive, it takes only admin not Admin. So please help me out how to put validates_uniqueness_of as case sensitive Thanks in Advance Surekha.Matte -- Posted via http://www.ruby-forum.com/.
2006 May 26
2
validates_uniqueness_of but only when exists
I want to validate the uniqueness of a field if the field has a value. Is there anyway to do it? -- Posted via http://www.ruby-forum.com/.
2006 Apr 05
2
validates_uniqueness_of with habtm
it''s a blog... class Entry < ActiveRecord::Base has_and_belongs_to_many :categories end similarly: class Category < ActiveRecord::Base has_and_belongs_to_many :entries end I wish to make sure that the owner doesn''t add the same category to a given entry more than once... I''m thinking that validates_uniqueness_of should be usable here. But can''t
2006 Oct 05
0
ActiveRecord Validations - validates_uniqueness_of
David Chelimsky <dchelimsky at gmail.com> wrote: > What I would really want to ensure here is that Person validates > uniqueness of email, not how it does it. What I would do is something > like: > > def test_person_should_validate_uniqueness_of_email > assert_true Person.new(:email => "a at b.com").save > assert_false Person.new(:email => "a at
2006 Feb 07
2
validates_uniqueness_of case Sensitive
Is there a option to make validates_uniqueness_of Case Sensitive, if so what is it, if not then how to do it without writing my own function. Regards Suraj
2005 Dec 20
0
validates_uniqueness_of on has_and_belongs_to_many
I am trying to create a model that allows only unique assets to be added to a category. However, they could be added again to a different category. Finally, an asset can be shared across many categories. So my question is how do you check the uniqueness across a join table? This does not compile.... has_and_belongs_to_many :categories, :foreign_key => ''asset_id''
2008 Sep 19
0
validates_uniqueness_of: passing a method to :scope
I was wondering if anybody knows an easy way to pass a method name as the scope option to a validates_uniqueness_of validation on a AR model? For example, I have nested models a bit like: class Survey has_many :areas end class Area belongs_to :survey has_many :questions, :order => ''position'' validates_uniqueness_of :position, :scope => : survey_id end class
2009 Jun 26
0
validates_uniqueness_of and MySQL enum type
I tried to check validates_uniqueness_of for a MySql enum type column with a scope given, like this: validates_uniqueness_of :phone_type, :scope => :user_id And It didn''t work. When I check the SQL statement for doing this validation, it is like this: SELECT `phone_numbers`.id FROM `phone_numbers` WHERE (`phone_numbers`.`phone_type` = BINARY '''' AND
2008 Jan 26
1
validates_uniqueness_of customization
Hey, I have a simple web app where I would like users to sign up with a maximum of two accounts per email address. What would be the rails way of accomplishing this. Is there anyway of modifying validates_uniqueness_of to perform the proper validations? Thanks -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you
2007 May 28
2
out-cheat validates_uniqueness_of
before_save :strip_strings validates_uniqueness_of :username validates_presence_of :username private def strip_strings self.username = username.gsub!(" ","") end example: username = " gissmoh-/upiLifMog2ELgA04lAiVw@public.gmane.org " becomes gissmoh-/upiLifMog2ELgA04lAiVw@public.gmane.org and is stored in the
2007 Nov 08
1
validates_uniqueness_of with conditions
Hello I have a user table in my db. A user has a status field, status is an INT an can be between 1-5. When a new user sign up I want to use "validates_uniqueness_of :login" in user model. But I don''t want to validate the new user against users with status == 5. Can I do this with some :if or :conditions? (I prefer not to use my own validate method) -- Posted via
2009 Jul 02
0
validates_uniqueness_of and attr_readonly
I notice that I always want to prevent the unique key of a table from being changed. Does that mean I always have to have attr_readonly right after validates_uniqueness_of ? Is there a single function that replaces both of these but has the same affect? Thanks. -------------------------------------------------------------------------------- Developing with Rails 2.3.2; Ruby 1.8.7 (2009-04-08
2006 Dec 09
1
validates_uniqueness_of serialize
ActiveRecord bug ? validates_uniqueness_of doesn''t work with serialize I''m trying to serialize, unserialize an Array-type property of a Object instance, and validate that the Array or serialized version is unique within the the scope of another property using :scope does anyone know a work around ? Anthony Green -- Posted via http://www.ruby-forum.com/.
2005 Oct 29
0
Problem with validates_uniqueness_of
Hi, I think I''ve found a problem with validates_uniqueness_of within ActiveRecord. My code is: validates_uniqueness_of :name, :on => :create, :scope => "zip", :message => "has already been taken" yet the docs say that when a record is created, a check is performed to make sure that no records exist in the database with the given value for the specified