similar to: Validation of facade columns

Displaying 20 results from an estimated 1000 matches similar to: "Validation of facade columns"

2006 Aug 19
5
Form helpers don''t work with facade columns?
Hello all, I''ve been trying to use a facade column but I notice that the form helpers don''t seem to respect the facade. In the following example I''m trying to story the prices as Integer values but present them to the user as decimals. class Product < ActiveRecord::Base def price=(new_price) write_attribute(:price, Float(new_price)*100) end def price
2006 Mar 02
6
Newb question about facade columns
Hello, I am trying to deal with a database table that contains a date in the form of the number of seconds since epoch. Data is inserted in this format by an existing script that I can''t change, so a schema change isn''t realistic. I would like to allow humans to view and edit this data in the form of an actual human-readable date. I figured a facade column would be the
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
2006 Feb 22
0
Rewriting attribute accessors?
I''m new to Rails and so was wondering if the following strategy is a good idea. Background: I''m writing a eCommerce application which has a Product model and an Option model, they are setup with a has_and_belongs_to_many relationship. The Product model features the ''base'' attributes of the product and then the shopkeeper *can* add one or more Options that
2006 Jun 01
2
Hiding an attribute
I am using a smallint database column to store several boolean flags. The flags are accessible thru facade column accessors. I''d like to hide the database column so all access is thru the facade accessors. How do I do it? TIA, Jeffrey
2009 Jun 09
0
[LLVMdev] Regular Expressions
> On Tuesday 09 June 2009 04:35, Török Edwin wrote: > > On 2009-06-09 12:27, Howard Su wrote: > > > This change break the MSVC build since no regex by default in Windows > > > MSVC platform. > > > > Perhaps we should add a regex implementation to lib/System? > > That's potentially a lot of work. I started looking at it and it would > involve
2009 Jun 09
6
[LLVMdev] Regular Expressions
On Tuesday 09 June 2009 04:35, Török Edwin wrote: > On 2009-06-09 12:27, Howard Su wrote: > > This change break the MSVC build since no regex by default in Windows > > MSVC platform. > > Perhaps we should add a regex implementation to lib/System? That's potentially a lot of work. I started looking at it and it would involve hiding the OpenBSD library under some other
2011 Jun 12
7
installation of Office 2007 under Arch x86_64 fails
Running x86_64 with multilib enabled and am unable to install office 2007 to a fresh wineprefix. Code: $ export WINEPREFIX=/home/facade/.wineprefix/office $ wine /media/dvd/setup.exe wine: created the configuration directory '/home/facade/.wineprefix/office' err:module:load_builtin_dll failed to load .so lib for builtin L"winemp3.acm": libmpg123.so.0: cannot open shared object
2008 Jul 14
1
question about method "hidden_div_if" in AWDR 2
I followed the sample code in AWDR 2 like this: store_helper.rb def hidden_div_if(conditions, attributes = {}) if conditions attributes["style"] = "display:none" else attr = tag_options(attributes.stringify_keys) "<div #{attr}>" end end store.html.erb <%= hidden_div_if(@cart.items.empty?, :id => "cart") %> <%=
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 May 21
2
Nooby partials / component problems
I''m stumped on what seems like should be a fairly easy thing, so I hope someone can point out my error. I wanted to show a few things on every page, so I added an application level template in "layouts". I added my styles in there, and put the controller name and action name into the TITLE tag for my own reference. So far so good - works like expected. Then I wanted to
2009 Jun 09
0
[LLVMdev] Regular Expressions
On Tue, Jun 9, 2009 at 12:00 PM, David Greene<dag at cray.com> wrote: > On Tuesday 09 June 2009 04:35, Török Edwin wrote: >> On 2009-06-09 12:27, Howard Su wrote: >> > This change break the MSVC build since no regex by default in Windows >> > MSVC platform. >> >> Perhaps we should add a regex implementation to lib/System? > > That's
2006 Mar 12
2
counter_cache reference/tutorial
I''m trying to use counter_cache, but I''m not doing something right. It is unreliable and I keep having to correct it manually. Is there a good tutorial or reference on how to use it on-line? I have the AWDR book, but I need something more complete. TIA, Jeffrey
2006 Apr 10
2
using web service for authenitcation
I am writting a web service for authenitcation of users and was using web_service_scaffold :invoke for testing it out...and was able to consume it using .NET. But my question is, whats the simplest method using which i can use the same web service in the current Web App. I mean, not from an external application or something but from the current web apps itself. I found one method in AWDR, and
2010 Jul 19
3
ActiveRecord override
Would really appreciate it if someone could tell me why this is happening: I override ssn method of AR class so I can encrypt/decrypt to/from the db: class Person < ActiveRecord::Base def ssn=(value) write_attribute(:borrower_ssn, Crypto.encrypt(self.encryption_key, value)) write_attribute(:borrower_ssn_final_four, value[5,4]) end def ssn # this begin - rescue can be
2006 Mar 17
2
SOA on rails...
We are in the process of evaluating new development frameworks for our future development platform. We currently use php and are evaluating Java, Ruby, Mono and .NET. We really like Ruby but unfortunately, we are having a hard time implementing our layered Service Oriented Architecture using Ruby due to the view being tightly bound to the ActiveRecord objects. Although we love all the great
2006 Jul 13
6
Migrations + foreign keys
Hi all, In the AWDR author use the execute method to declare foreign keys: execute "alter table.... add constraint.... foreign key...." Is there a ruby sintax to declare a foreign key in a migration class? -- Posted via http://www.ruby-forum.com/.
2006 Feb 04
1
Issues with sending HTML email
Hello, I am using the SaltedLoginGenerator. Everything is working fine except the e-mail is being sent out as text instead of text/html. I have tried changing the Content-Type to text/html but to no avail. I even tried changing the Content-Type in tmail/facade.rb but it didn''t help. What am I missing? How can I get ROR to send a HTML email. Thanks Frank
2004 Jul 05
3
Randy Bush is a destructive force with a hidden professional agenda
. Monday, July 5, 2004 15:50:06 (-08:00hrs UTC) Hello asterisk-users, From the following post: On Mon, 5 Jul 2004, Joe Baptista wrote: > On Mon, 5 Jul 2004, Randy Bush wrote: >> i did not criticize the protocol. remember, my question started >> with >> >> >> i am looking at iax to
2006 Feb 08
1
Adding children via small subform
I''ve read AWDR and especially the part concerning adding child line_items to an order. Unfortunately I want to do my process in reverse and in doing what I thought would work I get a null object error when trying to append the children to the parent. This is a _major_ stumbling block in my Rails use as almost every one of my projects has needed this so its a pretty vital problem I need