Displaying 20 results from an estimated 3000 matches similar to: "case insensitive inclusion validation"
2010 Nov 02
2
Why can I do a case insensitive Validation but not Find?
Why can I do this....
validates_uniqueness_of "username", :case_sensitive=>false
.... but not this....
User.where "Xx", :case_sensitive=>false
?
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to
2006 Apr 20
7
Rails + postgres case insensitive searches.
Hello all
I am wondering how rails handles case sensitivity in databases. If I
do a Person.find_all_by_name("tim") in mysql I would expect to get
tim, TIm, and Tim. Do I only get tim in postgres?
How do other people deal with this? Do you resort to find_by_sql for
all your postgres queries to get case insensitive results?
2006 Mar 10
5
case insensitive search
I am having trouble with a simple gallery search.
I type in a segment of the address and i only
seem to be getting results if I use the correct case.
This is in my Gallery controller:
def search
@gallery = Gallery.find(:all, :include => :property,
:conditions => "address LIKE ''%#{@params[:keywords]}%''")
end
On a different note:
I am having
2006 Aug 14
3
case insensitive exclusion_of
I have the following validation code, however it will allow variations
in case. Like ''Admin'' and ''admiN'', etc
validates_exclusion_of :login, :in => %w( admin ),
:message => "is reserved for system accounts"
how can I make this validation case insensitive?
--
Posted via http://www.ruby-forum.com/.
2008 Jun 06
1
Making sorting case insensitive
Hello,
I''ve been trying to make sorting in ferret case insensitive without
any luck. I''ve been searching the mailing list, the docs and nothing.
Apparently setting the type option for the sort to string should do
it, but it doesn''t.
Does anyone know how to achieve this?
Thanks.
--
Efr?n D?az
http://www.efrendiaz.com
2012 Dec 04
2
[Rails 3.2] validation on create not working
class Place < ActiveRecord::Base
validates :description, :presence => true
validates :description, :uniqueness => {:case_sensitive => true, :on =>
:create }
# also tried
# validates :description, :uniqueness => {:case_sensitive => true }, :on
=> :create
On update ( in form fields, updated label, same description )
params
2008 May 23
20
Rails validation is inefficient
Hi,
I have a User model, with a validates_uniqueness_of :login
The generated SQL for the validation is:
SELECT * FROM `users` WHERE (LOWER(users.login) = ''fernando'' AND
users.id <> 10001) LIMIT 1;
and it takes 0.13s to happen (my table has 10.000 rows)
When I use the EXPLAIN instruction on it, it shows that it will use the
primary_key as index, but this is not
2011 May 14
3
regpatch writing to local registry hive with -F not working (registery-utils 4.0.0~alpha15~git20110124.dfsg1-2ubuntu1)
Hi,
I was hoping I could modify a locally mounted registry hive using
regpatch and a .reg file but the -F argument seems to have no function.
(Strace shows it ignores it and just operates
on /var/lib/samba/private/hklm.ldb)
Below is output with debug on.
rfm6 at ubuntuSSDx64:cp /mnt/xp/WINDOWS/system32/config/software /tmp/software
rfm6 at ubuntuSSDx64:/tmp/config$ sudo regpatch -d=10 -F
2006 Jan 09
3
Pagination :conditions not working - MySQL v. PostgreSQL, Rails abstraction v. embedded SQL
Hi everyone,
I have this code:
@person_pages, @people = paginate :person, :per_page => 20,
:conditions => [ "username LIKE ? OR first_name LIKE ? OR
last_name LIKE ? OR preferred_name LIKE ?",
"%" + params[:q].downcase + "%",
"%" + params[:q].downcase + "%",
2010 Nov 28
2
Dynamic find_by method returning nil in a class method
I have a user Model with a class method that I am using to do some
authentication
basically something like this
class User < ActiveRecord::Base
attr_accessor :password
attr_accessible :first_name, :last_name,
:email, :birth_date, :sex,
:password, :password_confirmation
email_regex = /\A[\w+\-.]+@[a-z\d\-.]+\.[a-z]+\z/i
validates :first_name,
2013 May 19
5
update_attributes() for a single column
I was just faced with a strange ROLLBACK exception when attempting to
execute this code:
$ rails console
user = User.first
User Load (1.1ms) SELECT "users".* FROM "users" ORDER BY
"users"."id" ASC LIMIT 1
=> #<User id: 1, name: "Michael Hartl", email: "foo-+RB1Aph5k6s@public.gmane.org",
created_at: "2013-05-12
2006 Mar 29
3
MySQL in dev, Postgres in prod - differences in "LIKE" query
Hi everyone,
I run MySQL in my dev environment, but Postgres in my production
environment (out of necessity). I''m having trouble finding a way to
write a query with a LIKE condition that is supported as case
insensitive in both databases.
Right now, I have this:
@query = "m" # for example
@people = Person.find(:all, :conditions => ["last_name LIKE ?", @query +
2017 Sep 05
4
login case sensitivity
hello,
some users' login fails since they type upper
case for their user ids ,etc ...
how can case sensitivity be disabled so they can login
with mix of upper and lower case?
this is what i tried:
in /etc/sssd/sssd.conf i tested this below
[domain/default]
case_sensitive = false
i stopped sssd, deleted all inside /var/sss/db and
started sssd but that did not help ....
thank you,
2017 Jan 20
2
SSSD cache case-sensitivity
Dear all,
I'm running CentOS 7.3 with SSSD. I'm using sssd-ad to talk to an AD
backend. Group names in the AD contain capitals.
When sssd-ad is working normally, group names returned are all
lowercase. However, when the AD backend goes offline, group names
returned from the SSSD cache contain capitals.
The change in case breaks stuff (sshd's AllowGroups, for one).
Has anybody
2013 Jul 10
1
domain RODC fails with default provisioning
We're evaluating joining another samba domain controller in read-only mode.
With a default provisioning, when running the samba-tool domain RODC, it
fails with the following error:
ldb: ldb_trace_request: (tdb)->search
ldb: ldb_asprintf/set_errstring: NULL Base DN invalid for a base search
ldb_wrap open of hklm.ldb
ldb: start ldb transaction (nesting: 0)
ldb: ldb_trace_request:
2018 Jul 25
1
[PATCH] v2v: rhv plugin - case-sensitive search queries
Changed both search queries to case-sensitive (to ensure an exact match).
---
v2v/rhv-upload-plugin.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/v2v/rhv-upload-plugin.py b/v2v/rhv-upload-plugin.py
index c6ba1962f..d787c9598 100644
--- a/v2v/rhv-upload-plugin.py
+++ b/v2v/rhv-upload-plugin.py
@@ -71,7 +71,7 @@ def find_host(connection):
storage_name =
2018 Jul 05
4
[PATCH] v2v: rhv plugin - find suitable host
From: root <root@localhost.localdomain>
For direct upload, a suitable host must be in status 'Up'
and belong to the same datacenter as the created disk.
Added these criteria to the host search query.
---
v2v/rhv-upload-plugin.py | 18 +++++++++++++++---
1 file changed, 15 insertions(+), 3 deletions(-)
diff --git a/v2v/rhv-upload-plugin.py b/v2v/rhv-upload-plugin.py
index
2019 Apr 15
1
[PATCH] v2v: -o rhv-upload: check whether the cluster exists
In the precheck script, check that the target cluster actually exists.
This will avoid errors when creating the VM after the data copying.
---
v2v/rhv-upload-precheck.py | 10 ++++++++++
v2v/test-v2v-o-rhv-upload-module/ovirtsdk4/__init__.py | 7 +++++++
2 files changed, 17 insertions(+)
diff --git a/v2v/rhv-upload-precheck.py b/v2v/rhv-upload-precheck.py
index
2018 Jul 05
2
[PATCH v2] v2v: rhv plugin - find suitable host
For direct upload, a suitable host must be in status 'Up'
and belong to the same datacenter as the created disk.
Added these criteria to the host search query.
---
v2v/rhv-upload-plugin.py | 28 ++++++++++++++++++++++++----
1 file changed, 24 insertions(+), 4 deletions(-)
diff --git a/v2v/rhv-upload-plugin.py b/v2v/rhv-upload-plugin.py
index da309e288..931fcfaa2 100644
---
2006 May 02
4
useful bit of code (hopefully)
Hi,
I often find myself using bits of code like this inside ActiveRecord,
perhaps it''s useful for others, or others can improve on it:
###########
# fix user input before validating it
before_validation :sanitize_input
# santize input before actual validation is called
# this uses the little methods defined below
def sanitize_input
trim %w(adres postcode woonplaats email naam