similar to: write attribute coming from where?

Displaying 20 results from an estimated 3000 matches similar to: "write attribute coming from where?"

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
2006 Apr 21
2
Using before_create and conflicting setter method...
Hi, I am having trouble using before_create when I have an specialized setter method: before_save :set_campaign_start #----------------------------------------------------------------------- ------- def set_campaign_start self.campaign_start = Time.now end # We want the date to always start at midnight
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 Jul 14
1
Weird validation problem
I have a field called Fax in my model. I store it as a 10-digit number with no other characters but I display it as a nicely formatted phone number. I have a validation on it like this: validates_format_of :Fax, :message => ''number should be formatted using (XXX) XXX-XXXX'', :with => /^\(\d{3}\)\ ?\d{3}-\d{4}$/ If I put 1234567890 (10 digits) in my field, the
2006 Feb 05
0
Enum patch for Rails
Hello! I''ve modified ActiveRecord a bit to support enum columns. This is tested only with MySQL, and maybe needs some changes for other adapters (if they use another syntax or quoting style). I believe this patch should be tested well, so I haven''t (yet) tried to post it to the official Trac. It is also not solid-as-a-rock when it comes to quoting ENUM values. After
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
2007 Nov 26
6
Model setters, override attribute=(attribute)?
Hi, I have a model similar Basket shown below. If customer_type is set then it should also set customer to nil. Likewise, if I set customer, it should inspect the customer_type attached to the customer and set accordingly within Basket. However implementing it as below doesn''t seem to work. Am I missing a better way to achieve this? I had also considered using a before_save
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
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
2011 Jun 04
1
S4 class, passing argument names to function, modify original
Hello, an S4 class "Foo" is defined with a setter, $. For several reasons, the setter calls a function, .foo.update(). However, bypassing the argument names of the setter does not work. Question 1: Why not and how can I fix this? Question 2: What is the way to define either the function or the setter to modify the original object (not returning the modified copy of it an overwrite the
2006 Mar 08
3
attribute or instance method or what?
Hi! Uhm are attributes just something like additional members of a class, other than those that come from the names of columns in the table? I''ve got images table, which has ''name'' column. I''ve added support for creating thumbnails out of uploaded pictures and i''d like to have an easy way of accessing them in my views. How to do it? I.e. my image
2006 May 07
1
Overwriting setters for associated objects
Hi all, I''m trying to overwrite a setter method, but am running into some difficulties. This is normally really easy when overwriting a setter for a table column, but in this case it is the setter for an associated object. Here''s a hypothetical example: class User < ActiveRecord::Base has_many :posts end class Post < ActiveRecord::Base belongs_to :user
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
2006 Jul 17
18
Inserting datetime value into SQL Server
I have a SQL Server column named StartTime of (SQL Server) type datetime If I attempt to set the attribute using public def StartTime=(time) write_attribute(:StartTime, "{ts ''1899-12-30 #{time.hour}:#{time.min}:#{time.sec}''}") end it''s inserting a NULL value. Anyone else able to successfully insert a date time value into a SQL Server table using
2005 Dec 25
0
Setter not being called
I have written the followign setter to raise an exception when the field disabled_on is beeing assigned a value minor or equal that the enabled_on field. class Survey < ActiveRecord::Base def disabled_on=(date) raise AssignmentException if date != nil and date <= self.enabled_on write_attribute(:disabled_on, date) end end The matter is that this method never gets called, as I
2006 May 10
2
ruby bindings odds and ends
In the Ruby bindings, set_X and get_X are renamed to remove the get/set, so MSet::get_matches_estimated() becomes a read-only property (if I have my terminology right) of the Ruby MSet class called matches_estimated. This matches how a Ruby programmer would expect a class to be designed. I was looking through the getters and setters list. I wonder if a few entries shouldn't be there, (the