similar to: text_field doesn''t call overridden ActiveRecord getters

Displaying 20 results from an estimated 200 matches similar to: "text_field doesn''t call overridden ActiveRecord getters"

2006 Mar 18
9
Using <%= text_field %> within partials is problematic
All, Thanks for any help in advance. I have what I think is a very straightforward partial template and I can''t figure out why a text_field call within it doesn''t work. Here is my calling template: lists.rhtml <div id="target_lists"> <%= render(:partial => "target_lists", :collection => @target_lists) %> </div> In the partial
2006 Mar 20
5
Wrap error_messages_for() call when no instance var present
I am trying to put some smarts around a call to <%= error_messages_for %> so that when I first come into this page i.e. when my instance variable @target_list has not been defined yet, the page doesn''t break. I''m doing this: <% if @target_list? %> <%= error_messages_for ''target_list'' %> <% end %> I get a syntax error on line 1.
2006 Mar 14
4
What does the send() method do on a model object?
All, I did a scaffold for a model and I ended up with this code in list.rhtml: <% for column in TargetList.content_columns %> <td><%=h target_list.send(column.name) %></td> <% end %> Where is the "send" method and what does it do? I can''t find it on ActiveRecord::Base? I assume that it returns a value based on the column id but I
2006 Jun 27
3
belongs_to <parent name>, :foreign_key modifier not working
All, I have two ActiveRecord objects. TargetList has_many Targets Targets belongs_to TargetList I''ve specified belongs_to :target_list, :foreign_key => ''DataSetID'' Queries generated by various methods in target_list do not seem to see the foreign_key name and keep trying to query my Target table using "target_list_id" (the default foreign
2006 Aug 14
1
What fields_for really for?
Hello everyone! I have 3 models: === 1 === class Region < ActiveRecord::Base has_many :districts end === 2 === class District < ActiveRecord::Base belongs_to :region has_many :suburbs end === 3 === class Suburb < ActiveRecord::Base belongs_to :district validates_numericality_of :region_id, :only_integer => true end In edit.rhtml for SuburbController I need to specify
2006 Mar 17
3
Timestamps casted to nil?
Hi, for some reason, all timestamp fields with or without time zone in my Postgres tables seem to be casted to nil. From console: >> me = User.find(''PS12345'') => #<User:0x2379788 @attributes={"mtime"=>"01.03.2006 13:26:32.737166", "valid"=>"8", "valid_from"=>"01.03.1999 14:09:21 CET",
2006 Jul 10
10
has_many :through and foreign key parameters
I just took my HABTM and turned it into a :through since my join table has another "non-joiny" attribute. I went from this: has_many_and_belongs_to :jobs, :join_table => ''tablename'', :foreign_key => ''x'', :association_foreign_key => ''y'' to this: has_many :jobs, :through =>
2006 Jul 11
4
checkboxes with a has_many :through relation
All, I''m populating a view with checkboxes in a list. I want to be able to assign to my has_many relationship using the post values of these checkboxes. Essentially, I want to populate the relationship table which will create the correct join values in my model. Here is my check_box_tag code: <%= check_box_tag("@current_job[target_list_ids][]",
2006 Jul 02
7
How can I intercept attribute calls?
Hi. I have two types of fields in my database, e.g. "name" and "name_ru". First one is a user''s name in english and the second one is in russian. I want to intercept calls like "c.name" and add "_ru" to it if current language is russian (I have my own Locale class like n Globalize). So I want such thing: -- Locale.set("en-US") c.name
2013 Oct 07
4
Feature request: FQDN Host match
Hello! I'm hoping that Gmail won't HTML format this mail so that I'll get flamed :) Anyway, my question relates to ssh_config. The problem I find is that the Host pattern is only applied to the argument given on the command line, as outlined in the man page: "The host is the hostname argument given on the command line (i.e. the name is not converted to a canonicalized host name
2006 Jun 14
0
Custom Primary Key, Using Primary Key in Form gives "before_type_cast" error?
Hi guys, I''ve got a problem here which i need help from the pro''s in this mailing list I have a legacy app where the User table has a custom structure where "User_id" (username) is the primary key as well as the username used to log in User.rb (model) class User < ActiveRecord::Base set_table_name "cmf901" set_primary_key "user_id" end
2006 May 09
11
model filter?
Hi All, Is there a way to filter / modify the output of a model class before it''s returned to controller/view that''s calling it? Example: I have a field phone_number which I always want to preformat using the number_to_phone() helper.... Any help is appriciated. Thanks! -- Posted via http://www.ruby-forum.com/.
2006 Jun 13
2
Custom Primary Key, Using Primary Key in Form "gives before_type_cast" error?
Hi guys, I''ve got a problem here which i need help from the pro''s in this mailing list I have a legacy app where the User table has a custom structure where "User_id" (username) is the primary key as well as the username used to log in User.rb (model) class User < ActiveRecord::Base set_table_name "cmf901" set_primary_key "user_id" end
2013 Feb 05
0
[LLVMdev] RFC: Replacing publicly accessible class IDs with getters
Hi Matthew, > In the process of porting the Polly plug-in to Windows we encountered a couple > of issues stemming from the use (within Polly) of global data from LLVM. > > By far the most common occurrence of this is the definition by a class of a > publicly accessible static ID, the address of which is used to uniquely identify > the class. For example > > class
2015 Nov 20
1
Good practice for naming classes, builders, attributes, getters/setters for object composition
Hey everyone, I am developing a package and I am wondering if there is a good practice for naming classes, builders, attributes getters and setters when dealing with object composition. I know that it is usually a good practice to give to the builder the same name as the class and, if possible, to avoid to use upper case letters. My problem is that, when I build an object containing an other
2020 Sep 07
0
Re: [libnbd PATCH 0/3] Improve type-safety of ocaml/golang getters
On Sat, Sep 05, 2020 at 08:40:57PM -0500, Eric Blake wrote: > Natural fallout after my recent testsuite additions that fixed a > couple of ocaml bugs in the setters. However, on at least the OCaml > code, I'm not sure what we should do if a newer libnbd ever returns a > bit that an older NBD.mli was not expecting at the time the OCaml > compiler ran (see below). I'm also
2013 Feb 01
2
[LLVMdev] RFC: Replacing publicly accessible class IDs with getters
On Wed, Jan 30, 2013 at 12:02:47PM -0600, Matthew Curtis wrote: > Hello all, > > In the process of porting the Polly plug-in to Windows we encountered a couple > of issues stemming from the use (within Polly) of global data from LLVM. > > By far the most common occurrence of this is the definition by a class of a > publicly accessible static ID, the address of which is used
2006 Oct 26
0
rescue_action overridden
In rspec_on_rails, method setup_with_controller, exists the following line: @controller_class.send(:define_method, :rescue_action) { | e| raise e } I understand that this is a better way to handle errors than the default. However, it gets in the way when you''ve defined your own rescue_action and are trying to test it. No good solutions came to me while I pondered the
2007 Dec 06
1
smartd.conf get overridden
Yohoo! I have some issues with the smartd in CentOS5/x64 I edited the /etc/smartd.conf for my needs and restarted the smartd with "service smartd restart". But the start script is overriding my file. I checked it and saw the following lines: ---------------/etc/init.d/smartd------------ case "$1" in start | reload | restart) GEN_CONF="*SMARTD*AUTOGENERATED*" [ !
2007 Aug 09
0
Profiles with an LDAP backend being overridden
Hi All, I've got LDAP running as the backend to Samba 3.0.24 and am trying to set the profile directories to mandatory for one group of users and roaming for another. To this end I'm using the sambaProfilePath in LDAP but it's getting overridden by something that's setting it to %u. As a result of this, when I log out of an account which points to the mandatory profile, it