Displaying 20 results from an estimated 10000 matches similar to: "validator to ensure two fields are different?"
2006 Jan 12
6
Mysql::Error: Lost connection to MySQL server during query
I have been very VERY frustrated for the past week trying to solve a
seemingly spurious problem with my Windows XP SP2 box with Ruby
1.8.2/Rails 1.0.0/MySQL 5.0.16 or 4.1.15 (yes, I tried both) installed
running against a remote MySQL server that was either 3.23 or 4.1
(4.1.15 to be exact--we finally matched them both up to make sure that
wasn''t the problem).
So I post it here (as
2005 Jun 18
1
Running general purpose queries
Hi,
I''m considering migrating my site from php to RoR. I''ve installed RoR gone
through the onlamp tutorials and made the recipie/todo list sample sites and
tinkered with a few of my own. I understand the examples that use models
and scaffolding to map tables, but I''m having a little trouble understanding
how to handle general purpose queries. A few people have
2006 May 04
3
Rubyonrails.org Website Blocked
Hi Everyone,
This is basically an FYI because I don''t think there is much that can be
done about it. I work at a DoD lab and up until very recently I had no
problems at all getting to rubyonrails.org. All week long I have not
been able to visit the site and I finally gave up and submitted a
trouble call to our network help desk. I was told that the site was in
a class B range
2006 Apr 27
4
GD2 to Make Charts
I''m just getting started with GD2 and have successfully made a few
dynamic PNGs. I need to make some fairly detailed line graphs on the
fly and I know that GD2 is capable of what I want but I strongly suspect
I''m reinventing the wheel badly. Are there gems or other projects that
help creating complex charts? I''ve used GDChart in the distant past
but I
2006 Jan 20
3
Is there a way to validate a model w/o saving it?
I have some code in my controller which looks like this:
if request.post? and @account.save and @user.save
...
end
and in my Account and User models I have many :validates, like so
account.rb
validates_presence_of :subdomain, :on => :create
validates_uniqueness_of :subdomain, :on => :create, :message => "is
already being used"
validates_exclusion_of
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/.
2006 Mar 24
2
Where to put array to be shared across models.
Quick question: I have an array of reserved words that I want to share
across most of my models so I can do something like this in the models:
validates_exclusion_of :username, :in => RESERVED_WORDS, :message => "This
username is a reserved word. Please choose another."
Here is a sampling of the the array:
RESERVED_WORDS = %w( blog blogs forum forums search login logout signup
2007 Jan 19
1
Bug Report: ACL plugin searches wrong directory with shared folders
I've been attempting to get to get Shared Folders and ACL's to work
under dovecot 1.0rc17. Unfortunately, I've run into some problems
(many have already been mentioned on the list), specifically the
problem where folder-specific ACL files are not found (and I will not
use Global ACL's due to the 100% probability of cross-namespace
mailbox name conflicts). My namespace
2006 Jul 11
4
validates_unlike plugin
Validates Unlike Plugin (v 0.1)
========================
Validates Unlike plugin validates that the value of the specified
attribute doesn''t match against the regular expression provided
Class Contact < ActiveRecord::Base
validates_unlike :comment, :with =>/html|http|onclick|onmouseover/ ,
:message => "comment can''t include: href,http,onclick,onmouseover."
2006 Jan 03
1
Virtual Hosts?
Well, I guess I''m successful because within a month of getting my very first
application online (and it''s barely functional) I now have to get a second
one up pretty quickly.
Basically, I have a rails application "myFirstApp", and a hostname
www.myfirstapp.com. Now I have a second rails app "mySecondRailsApp" and I
need www.mysecondapp.com to peacefully
2006 Apr 01
1
Tuning for large number of directory entries?
I have been running a public MySQL server for over 4 years. The system was a 1GHz box with 256MB of RAM. MySQL puts each database into a seperate directory in a single "data" directory. Once the old system reached about 10K databases the connection times increased 10X or more. I attributed the speed problems to a possible filesystem limitation with a large number of files. That
2003 Mar 06
1
ext3 and indexed directories
I work with a MySQL installation containing several thousand databases. MySQL represents each database as a seperate sub-directory of the main MySQL data directory. As the number of databases increases it seems that the time to connect is increasing significantly and I believe this is probably due to the time necessary to search through the large number of directory entries.
It has been
2005 Dec 18
1
session temp files?
I''m running a simple WEBrick server for a small rails website. I probably
get less than 100 hits per hour. I just looked in /tmp on the server and
there are over 10,000 ruby_sess.* temp files containing:
" hash{"
flashIC:''ActionController::Flash::FlashHash{:
@used{
They''ve piled up so much that I can''t even rm -f ruby*. Bash complains
2002 Sep 05
1
EXT3 Corruption Question
Greetings Everyone,
A group in my office is designing/integrating what I would loosly label as an "embedded system". In that, it performs a dedicated task and is not a general purpose workstation or server. It operates in a harsh environment, particularly a questionable power environment and they are extremely concerned about inadvertent shutdown and recovery. They were totally
2005 Nov 18
2
Migrate Ubuntu Rails App to Fedora?
I developed a small RoR app on my Ubuntu laptop and I just tried to migrate
it to my "production" box which is Fedora FC3. I moved the entire rails
app. I received this error when I tried to get the first page:
[2005-11-17 15:36:00] INFO WEBrick::HTTPServer#start: pid=32546 port=3000
192.168.0.61 - - [17/Nov/2005:15:40:01 EST] "GET /freesql HTTP/1.1" 200 0
- ->
2008 Apr 04
6
validates_numericality_of :not_equal_to
I have a situation in which I want to validate a number is not zero.
Both positive and negative values are acceptable, just not zero.
validates_numericality_of has an :equal_to attribute, but I don''t see a
:not_equal_to. I have not yet been able to find anyone who has
discussed this. I did find information about custom validators, so I am
now using a custom validator to check the field
2009 Jun 22
4
modal validation not works
Hi everyone,
i have 20 fields in users table.
in my admin profile module the admin can modify his infomation.
but only 12 fields he can able to modify.
so in my controller
if params[ :profileinfo ][:first_name]
@profileinfo.update_attribute(:first_name,params[ :profileinfo
][:first_name])
end
the above simply saves what i enter into the field.why it doesnot
consider the modelvalidation.
2011 Apr 21
1
Rails 3 Foreign Domain routing - cannot get this to work!
Hello,
I''m trying to build an app (mysuperapp.com) that allows users to create
an account in which a default subdomain (IE: joeshmoe.mysuperapp.com) will
be
created as their homepage. In their profile settings, I also want to give
them the ability to add their own domain name so their homepage now can be
joeshmoe.com. I know this is possible in rails w/ plugins like
subdomainfu
2005 Dec 29
2
validation highlighting on non-scaffold fields
Hi all,
I''m new to rails.
I have created a bunch of CRUD code using scaffolds.
I had to add code to the default output to account for
fields that establish the relationships between tables.
Everything works well, including the validation of the
fields I added. However, I can''t get the highlighting
to work for my fields when they fail validation and the
view is redisplayed.
2005 Aug 05
1
Validator
For whatever reason I decided to implement the validator class tonight.
It''s my first go at implementing the class. My first run at it looked
pretty good. I just added a generic .i for it and it all compiled.
Sadly, the samples didn''t work because the base Validator class can''t
actually be used as a validator! You have to derive from
GenericValidator. I