similar to: Weird validation problem

Displaying 20 results from an estimated 8000 matches similar to: "Weird validation problem"

2006 Jul 13
4
Does text_field go directly to attributes hash in AR object?
All, I''m having a hell of a time figuring out what is going on here. I''m trying to override one of my getters so that I can format it a certain way in my form. But I can''t seem to get text_field to call the appropriate method on my object. So here''s my getter: public def FAX fax = read_attribute(:FAX) puts fax
2007 Mar 30
1
write attribute coming from where?
There are datatypes that need to be converted back and forth from a string representation: they need to be parsed both coming from the database, and coming from elsewhere like views. Dates are an example, and I recently needed to implement a more forgiving converter for decimal numbers. So we have here at least two flows of execution, for example: post.date = "22-jan-2007"
2006 Jun 01
1
Automatted Getter/Setter
Hey.. So I have a model that has a lot of number fields. Each of these go through a process when read in and read out to add/remove commas (between every three numbers) to make them more readable. The getter I currently have is like this: def sale_price Listing.insert_commas(read_attribte (:sale_price)) end and the setter is: def sale_price=(price) write_attribute(:saleprice,
2006 Jun 04
1
Problem with instance variables
Im developing a User model for my application (newbie stuff, but I have to start somewhere). I followed the tutorial at http://sonjayatandon.com/05-2006/how-to-build-a-secured-web-application-with-ruby-on-rails/ and decided to add an email field. The problem is that the email is not being saved on the database and I end up with two email variables: @email and email. validates_presence_of
2012 Sep 09
2
mattr_accessor inside a class
Rails extends Ruby with mattr_accessor (Module accessor). As Ruby''s attr_accessor generates getter/setter methods for instances, mattr_accessor provide getter/setter methods at the module level. In below example, you see that mattr_accessor declared in the class context of LookupContext. It''s declared in class, not module. However, modules are defined in LookupContext, for
2010 Dec 30
6
validates_inclusion_of doesn't match constant
Hello, I have a model Model: SPECIAL_FEATURES = %w(none top) class Model validates_inclusion_of :special_feature, :in => Model::SPECIAL_FEATURES, :on => :create, :message => "special_feature %s is not defined" belongs_to :team def special_feature attributes = attributes_before_type_cast if attributes["special_feature"]
2008 May 18
4
[LLVMdev] Opaque type usage to represent foreign types
In my project I have a group of foreign types (C++ classes) that I want to use, but don't want to represent as structs within LLVM. For example, for each field in each C++ class I have a setter and getter function that I'd like to use. The setters and getters are "extern C" functions to avoid problems with C++'s name mangling. After going over the documentation it
2010 Apr 18
1
Getter and Setter with non DB property
Hi, I can''t find how do i created a getter and setter property for a non db property. what i have done isnt working, i have a cnt mass assign error. Here is what i''ve done: attr_accessor :creator_is_participant def creator_is_participant @participe end def creator_is_participant=(participe) if participe == true @participe = true else @participe
2006 Jul 03
4
text_field doesn''t call overridden ActiveRecord getters
All, In a template, I have <%= text_field :target_list, :DateReceived, { :title => ''uploaded_at'', :class => ''target_list_info'', :disabled => ''true'' } %> Here is the DateReceived method on my
2009 Aug 17
1
Problem with setter override on ActiveRecord
(This message was originally written on StackOverflow -- the formatting is much prettier there -- http://stackoverflow.com/questions/1283046/problem-with-setter-override-on-activerecord) This is not exactly a question, it''s rather a report on how I solved an issue with write_attribute when the attribute is an object, on Rails'' Active Record. I hope this can be useful to others
2008 Apr 25
3
[ANNOUNCE] Samba 3.2.0pre3
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Release Announcements ===================== This is the third preview release of Samba 3.2.0. This is *not* intended for production environments and is designed for testing purposes only. Please report any defects via the Samba bug reporting system at https://bugzilla.samba.org/. Please be aware that Samba is now distributed under the version 3 of
2008 Apr 25
3
[ANNOUNCE] Samba 3.2.0pre3
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Release Announcements ===================== This is the third preview release of Samba 3.2.0. This is *not* intended for production environments and is designed for testing purposes only. Please report any defects via the Samba bug reporting system at https://bugzilla.samba.org/. Please be aware that Samba is now distributed under the version 3 of
2009 Sep 23
5
Overriding AR read/write_attribute - Overridden write_attribute Is Never Called
Could someone explain this? #config/initializers/ar_attributes.rb module ActiveRecord module AttributeMethods alias_method :ar_read_attribute, :read_attribute def read_attribute(attr_name) p "read_override" ar_read_attribute(attr_name) end alias_method :ar_write_attribute, :write_attribute def write_attribute(attr_name, value)
2006 Jan 14
0
Overriding column accessors?
Hi, Is it possible to override the default accessors that are created by Rails? For instance I had this User object which has the column headings "password" and "salt" in its SQL table. I did manage to override the setter accessor for password by using def password=(new_password), but when I tried doing the same for the reader by using a def password method (to return a
2006 Jul 14
7
Form validation - keepin correct fields displayed on refresh
All, I''m finally doing my first real form in Rails - the model object that I''m entering information for has 8 validations so far. If I type in good values for all the fields but one, I get the pretty validation, and the nice field highlighting, but all of the fields are cleared, forcing me to retype all of that info. That is a big drag. Is there a standard way to get the
2008 Jun 10
4
[ANNOUNCE] Samba 3.2.0rc2
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 ================================= Release Notes for Samba 3.2.0rc2 June 10, 2008 ================================= This is the second release candidate of Samba 3.2.0. This is *not* intended for production environments and is designed for testing purposes only.
2008 Jun 10
4
[ANNOUNCE] Samba 3.2.0rc2
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 ================================= Release Notes for Samba 3.2.0rc2 June 10, 2008 ================================= This is the second release candidate of Samba 3.2.0. This is *not* intended for production environments and is designed for testing purposes only.
2008 May 23
4
[ANNOUNCE] Samba 3.2.0rc1
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Preamble: Please help us testing this release candidate! If there are no major catastrophes, it will become the first major release of Samba 3.2.0. It might take a few hours until the files will be spread to all mirrors. ================================= Release Notes for Samba 3.2.0rc1
2008 May 23
4
[ANNOUNCE] Samba 3.2.0rc1
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Preamble: Please help us testing this release candidate! If there are no major catastrophes, it will become the first major release of Samba 3.2.0. It might take a few hours until the files will be spread to all mirrors. ================================= Release Notes for Samba 3.2.0rc1
2007 May 04
5
[ win32utils-Bugs-10589 ] Bug in win32-mmap
Bugs item #10589, was opened at 2007-05-04 12:01 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=411&aid=10589&group_id=85 Category: win32-mmap Group: Code Status: Open Resolution: None Priority: 3 Submitted By: Daniel Berger (djberg96) Assigned to: Daniel Berger (djberg96) Summary: Bug in win32-mmap Initial Comment: Ruby 1.8.6 win32-mmap 0.2.1 Assigning