similar to: [Rails 3.2] validation on create not working

Displaying 20 results from an estimated 3000 matches similar to: "[Rails 3.2] validation on create not working"

2012 Oct 02
3
case insensitive inclusion validation
I want to add case_sensitive option to inclusion validation. This will allow to do: validates :numbers, :inclusion => { :in => %(One Two), :case_sensitive => false } Does it make a sense? Thanks. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To view this discussion on the web visit
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,
2012 Nov 29
2
[Rails 3.2] form_tag w :remote => true doesn't fire up the js format
I have a form_tag written like this : = form_tag search_backoffice_places_path, {:remote =>"true", :id => :searchplaceForm } do .. input fields = submit_tag t(:search) generated html is correct : <form accept-charset="UTF-8" action="/en/backoffice/places/search" data-remote="true" id="searchplaceForm" method="post"> ...
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
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 =
2012 Oct 16
8
<form> tag is self-closing before input fields .. (HAML generator used)
The form is inside a table, enclosing a <tr> = form_tag admins_backoffice_dashboards_path, :remote =>"true" do %tr.search %th= link_to t(:clear), "#", :id => :clearFilter %th= select_tag :role, options_from_collection_for_select(Role.global, :id, :name, :selected => @role_id ) %th= text_field_tag :email, nil, :value
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
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
2011 Dec 05
2
How to bypass a create record after validation wo error ?
I have a specific signup process to handle, and I am turning around the solution wo finding a clear validation ... a visitor fill in a User Registration form ( email /pwd /pwd confirmation ) I wrote a UserValidator class to check the uniqueness of the email field # if no user registered w this email, then no error , can proceed to create User.where(:email => self.email).empty? # no
2012 Nov 09
8
method conditional option pattern
When I have this pattern sign_me(@user, :event => :authentication, :subdomain => subdomain) how can I write it to avoid sending the :subdomain option if subdomain.nil? ( if possible ..) sign_me(@user, :event => :authentication #?, :subdomain => subdomain unless subdomain.nil? ) -- You received this message because you are subscribed to the Google Groups
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 ---
2018 Jul 24
3
[PATCH] v2v: rhv plugin - fix DC search string
Search for DC by 'storage.name=' to make it explicit. I.e. "storage=" uses regex, so similar names can be found in the search query. For example, searching for a domain named FCSD, will find FCSD1 as well. --- v2v/rhv-upload-plugin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/v2v/rhv-upload-plugin.py b/v2v/rhv-upload-plugin.py index c72f5e181..c6ba1962f
2007 Jul 30
3
validates_uniqueness_of doesn't work if value tested is numeric and column is string
Hello all, I am working through the depot example in the rails book. If I add a validates_uniqueness_of to a string column in the model, and then try to create a record with a number in this string column I get an SQL error. Looks like the SQL generated to test for uniqueness does not quote the value if it''s numeric even though it''s comparing against a varchar column. It does
2009 Mar 23
5
Rspec weird behaviour
Hi, I recently migrated from classic rails testing to Rspec, so I am pretty new to the framework and still learning. I am getting weird errors on an ActiveRecord model test, here is the basic class model definition: class Size < ActiveRecord::Base has_many :quantities, :dependent => :destroy validates_presence_of :name validates_uniqueness_of :name, :case_sensitive => false end
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
2013 Apr 03
1
validates uniqueness scope allow_blank/allow_nil -> validation error
I have this in a model: class GenreBadge < ActiveRecord::Base belongs_to :game, counter_cache: :genre_badges_count, touch: true belongs_to :genre validates :game_id, uniqueness: {scope: :genre_id}, allow_blank: true end When I get one existing genre badge genre_badge = game.genre_badges.first genre_badge.game_id = nil genre_badge.save! It creates an validation exception:
2018 Jul 24
1
Re: [PATCH] v2v: rhv plugin - fix DC search string
On Tue, Jul 24, 2018 at 7:27 PM Richard W.M. Jones <rjones@redhat.com> wrote: > On Tue, Jul 24, 2018 at 07:16:10PM +0300, Daniel Erez wrote: > > Search for DC by 'storage.name=' to make it explicit. > > I.e. "storage=" uses regex, so similar names can be > > found in the search query. For example, searching for > > a domain named FCSD, will find
2018 Jul 31
1
[PATCH] v2v: -o rhv-upload: PEP8 fixes for rhv-upload-plugin.py
- wrap a too long line - join strings in multiple lines using + (plus) instead of \ (backslash) --- v2v/rhv-upload-plugin.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/v2v/rhv-upload-plugin.py b/v2v/rhv-upload-plugin.py index 4fad27fb8..bdc1e104a 100644 --- a/v2v/rhv-upload-plugin.py +++ b/v2v/rhv-upload-plugin.py @@ -86,7 +86,8 @@ def find_host(connection):
2008 Aug 21
1
validates_uniqueness_of not working - urgent
I''m using restful_authentication to let users register and login. Lately, however, I''m seeing multiple login and emails being created even though I have validates_uniqueness_of as below: user.rb validates_uniqueness_of :login, :email, :case_sensitive => false mysql> select id, login, email, created_at, state from users;
2011 Jul 19
0
Ruby on Rails Tutorial Chapter 8 Signup Success
I have written the Users controller and Spec tests correctly for the "successful creation" in the User controller however I get the following two errors: 1) UsersController POST ''create'' success should create a user Failure/Error: lambda do count should have been changed by 1, but was changed by 0 #