Re: [Rails-core] [Security] validates_numericality_of can be tricked into accepting anything

2006-07-30 Thread Hampton
Nice catch! +1 from me! -hampton. On 7/30/06, Andreas Schwarz <[EMAIL PROTECTED]> wrote: (I would have posted this to the tracker, but I get an error message when I try to create a ticket.) validates_numericality_of uses the regular expression /^[\+\-]?\d+$/, but because ^ and $ mat

Re: [Rails-core] Understanding Active Records innards

2006-06-29 Thread Hampton
Pete-I've been toying with a few chapters of a book to do just that.About half is API and uses. Then the other half of the book explains *how* it works. And some of the fun/cool tricks going on inside in the guts to make the usibility so simple. But, its quite a while from being done...-hampton.On

Re: [Rails-core] Tests Broken!

2006-06-25 Thread Hampton
This patch fixes the errors I was getting. On 6/24/06, Coda Hale <[EMAIL PROTECTED]> wrote: On 6/24/06, Hampton <[EMAIL PROTECTED]> wrote: > Looks like some changes made in the Ennumerable extensions had some > majorly negative effects on the Summing ability of AR.

[Rails-core] Tests Broken!

2006-06-24 Thread Hampton
ctive_record/associations/association_proxy.rb:123:in `method_missing' ./test/../lib/active_record/associations/has_many_association.rb:95:in `method_missing' ./test/calculations_test.rb:152:in `test_should_sum_scoped_field' Working on a way around this right now -hampton. _

[Rails-core] Plugin Discussions

2006-06-04 Thread Hampton
ople to use it." Perhaps its a matter of misunderstanding, but I believe clarification of meaning would be helpful to keep the misunderstandings to a minimum. Thoughts? Feelings? Flames? Or, is this a non-issue?-hampton. ___ Rails-core maili

Re: [Rails-core] Routing rewrite, checked in

2006-06-01 Thread Hampton
Further:I was trying to fix my code to use the nil method, and here was the result:url_for(:page_number => 3, :id => nil)"/video/2?id="That's definitely not the desired behaviour. -hampton.On 6/1/06, Hampton <[EMAIL PROTECTED]> wrote: Let me give you a more full exampl

Re: [Rails-core] Routing rewrite, checked in

2006-06-01 Thread Hampton
n"=>"index", "id"=>"21",> "controller"=>"video"}>> then, I would do this. >> redirect_to(:controller => "video")>> The url it redirects to is...>> "video/index/21">> While, I would e

Re: [Rails-core] Routing rewrite, checked in

2006-06-01 Thread Hampton
I have an application that broke.This may be an unwanted behaviour, or not, but I was working with this as a feature for using some crazy-routing for pretty urls.url = "" => {"action"=>"index", "id"=>"21", "controller"=>"video"} then, I would do this.redirect_to(:controller => "video")The url it re

Re: [Rails-core] AR: DAAP connection adapter?

2006-05-25 Thread Hampton
to create a layer for DAAP as its structured and would require a model for each structured data type. Since there is a gem for DAAP it would be trivial to use that object within a project and actively use the DAAP connection during your webserver existance. (I'm not saying it would be fast.)-

Re: [Rails-core] Filtering with ActiveRecord

2006-05-23 Thread Hampton
Is there anything I can do to help this patch get vetted quickly and efficiently?-hampton.On 5/21/06, Hampton < [EMAIL PROTECTED]> wrote:Introducing Patch #5143! http://dev.rubyonrails.org/ticket/5143This patch allows for a hash to be passed into the :condition parameter of the ActiveRecord

Re: [Rails-core] Filtering with ActiveRecord

2006-05-21 Thread Hampton
tests with the patch to see if it functions correctly with Oracle and Postgres, it would be much appreciated!-hampton. I would look sympathetic to a patch that allowed for hash definitions of :conditions, though.   ___ Rails-core mailing list Rails-core

Re: [Rails-core] resend: is there a list of standard keywords in trac?

2006-05-15 Thread Hampton
I'm stepping out there to day this. There are obviously keywords which are re-used time and time again and perhaps could be put in an official list.However, I'm not surprised that people are not jumping towards codifying the keywords list into a strict guildline. If you want to give the new usersad

Re: [Rails-core] Filtering with ActiveRecord

2006-05-14 Thread Hampton
offsets, they are free to be more verbose. But, I think find_with(attrib) is a nice addition to ActiveRecord in the style of find_by_*. Thoughts? Comments? Flames?-hampton.On 5/14/06, Tom Ward <[EMAIL PROTECTED]> wrote: On 5/13/06, Hampton <[EMAIL PROTECTED]> wrote:> Let's

[Rails-core] Filtering with ActiveRecord

2006-05-13 Thread Hampton
:last_name = "Catlin)Do you guys think this is useful? Its already written and I've been using it on a few projects. I've personally found it useful, but is this the kind of thing that you guys think AR might need? Thoughts/comments/flames welcome. -hampton.

Re: [Rails-core] ganging up on tests and docs

2006-04-26 Thread Hampton
Just, while you're there writing your patch for some else, just snap in a few programmers notes. If we all do that passively as we work on other stuff, then eventually we will have some smashingly good internal documentation for the project.Thoughts?-hampton On 4/26/06, Jamis Buck <[EMAIL PRO

Re: [Rails-core] ganging up on tests and docs

2006-04-26 Thread Hampton
Hey man, I'm up for helping with the docs.My vote: RJS docs.Once you get a list up, make sure to pass the link out here."Let's get it on!" (TM)-hampton. On 4/26/06, Kevin Clark <[EMAIL PROTECTED]> wrote: I'll take it. I'll post on my blog about it tonight and

Re: [Rails-core] What are your expectations when updating related objects ?

2006-04-17 Thread Hampton
Here is my problem with such a system.If we took this code bit... > def edit>   @contact = Contact.find(params[:id])>   @phone = @contact.phone>   @phone.attributes = params[:phone] >   return if @contact.update_attributes(params[:contact])>   # handle validation errors> endAs far as @contact.phone

Re: [Rails-core] ERb Changes

2006-04-06 Thread Hampton
I'm more referring to those instances when a full partial with Builder is a bit overkill but then again, line-by-line ERb is a little inelegant and awkward.I just feel that some system like this (and, I like Adam's implementation better) would have low overhead and possibly enable more beautiful co

[Rails-core] ERb Changes

2006-04-06 Thread Hampton
operly, could really improve ERb readability. I would not suggest making this a "recommended" way to output information, but just a useful helper for creating excellent looking ERb code. Thoughts?-hampton catlinPS: I know this must seem trivial after the "Oracle Debacle of 2006".