[Rails-core] Re: Possible bug with chained where methods on 3.0.4

2011-02-16 Thread Chris Cruft
+1 for the the original behavior where chained clauses are ANDed (POLS). On Feb 16, 8:35 am, Brian Morearty wrote: > > Sound arguments. I didn't implement collapse_wheres, just in case a > > witch hunt starts. I was just the first person awake this morning to > > pose the answer. :) > > Understoo

[Rails-core] Action Caching with Mime::Responder logic

2010-10-11 Thread Chris Cruft
I ran into some issues with the response content type for action- cached pages. After digging through the code and reading up on some of the lighthouse tickets, I'm proposing a reset of the thinking for how cached content is matched up to requests. The biggest problem with the current implementat

[Rails-core] Re: Suggested validation for boolean does not work

2010-06-01 Thread Chris Cruft
Jarl, I've been listening in on this conversation and it brings to mind a discussion a while back on the use of presenters and reverse presenters. Since the dawn of time, ActiveRecord (and perhaps even ActiveModel) has been tightly wedded to the concept of unreliable human input (= HTML forms). G

[Rails-core] Re: enhancement for write_asset_file_contents of AssetTagHelper module [patch]

2010-01-22 Thread Chris Cruft
The thought of parsing the stylesheets to replace url references seems pretty clunky. Could something like Sass address this problem more cleanly? On Jan 20, 6:29 pm, Corin wrote: > Hi all, > > when using stylesheets caching in rails, one might get problems if the > stylesheets contain relative

[Rails-core] Re: ActiveRecord timestamp conversions fail for some cases

2010-01-15 Thread Chris Cruft
I spent an entirely inappropriate amount of time digging into this issue... Here are some observations: The #microseconds method LOOKS clumsy, but it's actually quite optimized. Turns out the the sec_fraction component is a Rational less than one. So converting as quickly as possible to som

[Rails-core] Re: ActiveRecord timestamp conversions fail for some cases

2010-01-15 Thread Chris Cruft
I gave up on that kind of resolution when I found that MySQL doesn't support it! I'll try to test the patch though. -Chris On Jan 14, 10:20 am, Jacob Lauemøller wrote: > Hi all, > > The microsecond handling in > ActiveRecord::ConnectionAdapters::Column#fast_string_to_time and > ActiveRecord::

[Rails-core] Re: Block label helper

2010-01-05 Thread Chris Cruft
Double bonus for this enhancement -thanks Stephen. I see that you have also made the "name" attribute optional -fantastic. Now one can implicitly apply a label to the enclosed input without having to worry about id matching with the 'for' attribute: label_tag nil, "Your Name" do text_field_tag

[Rails-core] Re: proposing Object#nonblank? (analogous to Ruby's Numeric#nonzero?)

2009-12-29 Thread Chris Cruft
Josh nailed it. This issue of empty strings coming back from forms has been around for eons (in Rails' hyperspeed timeframe). Firing up the wayback machine, we see this: http://dev.rubyonrails.org/ticket/5694 BTW, here's my take on a solution using a before filter to recursively coerce empty

[Rails-core] Fix nested attribute error messages introduces new requirement -on purpose?

2009-11-07 Thread Chris Cruft
This commit (f5f7c40f3aedf88b2aef4e83602a4f41ffa5d0ab) introduces a new limitation for ActiveRecord::Base instances that has (to my knowledge) never been discussed. Briefly: an error on an attribute cannot be set as the result of an exception computing the value of the attribute. For example: d

[Rails-core] Re: Patch for review: make :delete_all on has_many with :primary_key not delete unrelated records

2009-11-07 Thread Chris Cruft
Bump. Worth a look as this is a data corruption situation... On Nov 3, 9:26 pm, Matt Jones wrote: > https://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/3086 > > Just what the subject says - on 2-3-stable, destroying an object with   > a has_many association using :primary_key an

[Rails-core] Re: OrderedHash and ActiveSupport hash extensions

2009-11-04 Thread Chris Cruft
Done. I've created the ticket and enclosed a patch here: https://rails.lighthouseapp.com/projects/16213-rails-guides/tickets/105-activesupportorderedhashreplace-results-in-corrupt-keys Turns out the problem was more fundamental than just OrderedHash#slice! -it's actually a problem in OrderedHash

[Rails-core] OrderedHash and ActiveSupport hash extensions

2009-11-03 Thread Chris Cruft
I have a method that removes some errors from the ActiveRecord::Base#errors object. After updating my app to 2.3.4, I find that the removal process is broken. Witness: h = {:a => 1, :b => 2} oh = ActiveSupport::OrderedHash[:a, 1, :b, 2] h.slice!(:a) h.keys => [:a] GOOD oh.slice!(:a);oh.key

[Rails-core] Re: Make model.number = "1 234" store 1234 instead of 1?

2009-10-28 Thread Chris Cruft
Henrik, I don't think Rails' principal of least surprise was meant necessarily to extend to your end-users' experience. It applies to YOUR experience. Then, in turn, you are responsible for making your users' experience unsurprising (amongst many other positive adjectives). The first developmen

[Rails-core] Re: Aggregations misbehave when converter returns nil

2009-06-09 Thread Chris Cruft
I know aggregations are not the most exciting part of Rails these days, but can someone please look at this ticket/post? -Chris On Jun 3, 8:56 am, Chris Cruft wrote: > For those of you that are familiar with composed_of/aggregations, I've > created a patch to address a small

[Rails-core] Aggregations misbehave when converter returns nil

2009-06-03 Thread Chris Cruft
For those of you that are familiar with composed_of/aggregations, I've created a patch to address a small bug in the writer's behavior when the converter returns nil. Currently the writer first checks for nil assignment, and only then does it set the mapped attributes to nil. If the assigned val

[Rails-core] Re: HasOneThroughAssociation should not be a child of HasManyThroughAssociation

2009-04-24 Thread Chris Cruft
"...aren't we supposed to be acolytes of Agile, and iterative improvements?" Yes. And I didn't mean to imply that a total refactoring of associations was an absolute condition of "success" or that a "just refactorings" effort does not have merit. Roughly, I'm in complete agreement with Adam's or

[Rails-core] Re: [Ruby on Rails #1642] HasOneThroughAssociation should not be a child of HasManyThroughAssociation

2009-04-23 Thread Chris Cruft
Having just spent a lot of time wading through the HMT and HOT code, I'll agree that there is a lot of room for improvement w.r.t. clarity. And if there is a general agreement that a refactoring is needed then the longer we wait the tougher the job will be. I would encourage Adam's effort. Howe

[Rails-core] Re: has_many :through scoped association

2009-04-22 Thread Chris Cruft
es (those that take > parameters) are not supported.  I could not think of a clean syntax to > deal with the > parameters and I wasn't (yet) prepared to support a proc/lambda as the > param.  As a side note, the chicken-and-egg problem of specifying > association by having ea

[Rails-core] Re: RFC: Enterprise-ready internationalization (i18n) for Rails

2009-04-22 Thread Chris Cruft
Get this man hooked up to the wagon! It's great to see this level of thought going into Rails I18n, and equally wonderful to know that his efforts could positively impact the framework. On Apr 21, 5:08 am, geekQ wrote: > We have been working on a Rails application for a big company, that > will

[Rails-core] Re: has_many :through scoped association

2009-03-31 Thread Chris Cruft
lean syntax to deal with the parameters and I wasn't (yet) prepared to support a proc/lambda as the param. As a side note, the chicken-and-egg problem of specifying association by having each end refer to the other frustrates clean syntax... -Chris On Mar 31, 12:24 pm, Chris Cruft wrote: >

[Rails-core] Re: has_many :through scoped association

2009-03-31 Thread Chris Cruft
The named_scope macro introduces a concise syntax for a complex set of [:order, :conditions, :joins, :include, :offset, :limit, :readonly] options for a model class. The options for the association macros use most of those SAME OPTIONS. My first suggestion is that association macros accept a :sc

[Rails-core] Re: has_many :through scoped association

2009-03-27 Thread Chris Cruft
This thread risks getting stale, which would be a shame because the need is obvious and we've got a couple of good proposals on the table. I took the time to more carefully review Ryan's proposed syntax, and I'm loving it. I will try to work up an implementation but I'll probably need someone el

[Rails-core] Re: Last call for patches - 2.3 final is imminent

2009-03-10 Thread Chris Cruft
Not a patch, but last I checked assert_select_email didn't work - undefined method in ActionMailer::TestCase subclasses. On Mar 9, 8:03 am, Pratik wrote: > Hey all, > > As  2.3 RC2 is out, the plan is to have the 2.3 final release out as > early as possible. So we'd like to make the last call fo

[Rails-core] Re: has_many :through scoped association

2009-02-28 Thread Chris Cruft
I'm liking all of this goodness. I suspect that the syntax of Ryan's solution will be more appealing to most. On Feb 27, 1:45 pm, Ryan Bates wrote: > -1 on inheritance solution. It is creative, but I imagine that can get > messy very quickly if you have multiple attributes you're trying to do >

[Rails-core] Re: PATCH: Support for String Lists in Mass Assignment of Associations via association_ids=

2009-02-22 Thread Chris Cruft
diff. It's quite short. All > it does it in the instance of adding multiple items to a many to many > relationship at once, it converts a _specific_ set... ["1,2,3,4"] to > [1,2,3,4]. It wouldn't do anything to ["A,B,C,D"] or anything else you > could dream

[Rails-core] Re: PATCH: Support for String Lists in Mass Assignment of Associations via association_ids=

2009-02-21 Thread Chris Cruft
It seems like this conversion would be better handled in the controller or model. Using anything other than integer primary keys also becomes riskier. So far Rails has done a pretty good job of permitting non-integer keys. I would hate to see that fall by the wayside. -1 On Feb 20, 7:39 pm, i

[Rails-core] Re: ar-defaults for rails 2.2.2

2009-02-17 Thread Chris Cruft
You mean like the 'id' column? On Feb 15, 9:42 pm, Will Bryant wrote: > non-constant default values is a thing that not many people use with > an ORM layer, and does not fit well into the ORM lifecycle; for > example, it is expected that when you initialize a new record, the > attributes on that

[Rails-core] Re: Tiny bug in ActionMailer

2009-02-02 Thread Chris Cruft
Matt, I've seen this behavior and wondered if that behavior was legit. But it didn't seem to have any adverse effect and so I moved on to other things. Admittedly, I didn't test the behavior of all mailers in the wild though... Can somebody definitively point to the SMTP spec for addressing and

[Rails-core] Re: HasOneThroughAssociation should not derive from HasManyThroughAssociation

2008-12-29 Thread Chris Cruft
+1 I pushed for this same refactoring a couple of months ago to fix some issues with assignment to the proxies. It's overdue. -Chris On Dec 27, 9:44 am, Adam wrote: > I see what these two classes have in common, but I don't like that > they share implementation via an inheritance relationship

[Rails-core] Re: Marking up errors on forms.

2008-12-29 Thread Chris Cruft
Completely agree with Frederick's initiative to clean this up. Letting the form builder control the error markup is appropriate. A default configuration that renders a shared partial for errors might be a good approach -that would allow customization of layout without customization of code. Oth

[Rails-core] Re: Problem with Rails.root being a Pathname

2008-12-08 Thread Chris Cruft
I know of at least two of my apps that will break. But I also agree with the sentiment of dealing with a slightly higher abstraction than just strings when working with the filesystem. So I'm willing to pay the (small) price and I thank you for bringing it to my attention! On Dec 7, 5:10 pm, "Mi

[Rails-core] Re: belongs_to, has_many counter_cache

2008-12-05 Thread Chris Cruft
associations. On Dec 5, 11:14 am, Chris Cruft <[EMAIL PROTECTED]> wrote: > I don't have a lot to offer to this subject except to say that in my > experience of building declarative bidirectional relationships in > Javascript (to proxy AR records!) I found that "promoting" the

[Rails-core] Re: belongs_to, has_many counter_cache

2008-12-05 Thread Chris Cruft
I don't have a lot to offer to this subject except to say that in my experience of building declarative bidirectional relationships in Javascript (to proxy AR records!) I found that "promoting" the associations to a full-blown model was quite clean. If done directly in AR, I could imagine somethi

[Rails-core] Re: Rails 2.2 misbehaves when full app stack is not wanted

2008-12-01 Thread Chris Cruft
Koz (or others), Has this issue has been addressed, and if so, in which commit? -Chris On Nov 7, 3:07 am, "Michael Koziarski" <[EMAIL PROTECTED]> wrote: > > Solution: I moved the `require_frameworks`call to the start of > > `Initializer#process`. Of course, `silence_warnings` is not defined by th

[Rails-core] Re: can't run: rake gems:install if application.rb depends on initializers

2008-11-25 Thread Chris Cruft
I've seen this behavior as well: my initializers were not being run during a gem install, but application.rb was being required. Inside initializer.rb, the "gems_dependencies_loaded" test was not being met and so the "load_application_initializers" method had no effect. In my case, the initiali

[Rails-core] Re: Reduce queries in uniqueness validation

2008-10-29 Thread Chris Cruft
Makes all the sense in the world. On Oct 28, 11:03 am, "Carlos Henrique Palhares" <[EMAIL PROTECTED]> wrote: > http://rails.lighthouseapp.com/projects/8994/tickets/1285-patch-reduc... --~--~-~--~~~---~--~~ You received this message because you are subscribed to the

[Rails-core] image_path/image_tag and absolute paths

2008-09-11 Thread Chris Cruft
Shouldn't asset tag helpers (like image_tag) be able to return absolute paths without asset_host being set? Both rely on compute_public_path to generate the path. Depending on the value of its "include_host" argument (always true when called from the image helpers), compute_public_path tries to

[Rails-core] Re: composed_of constructor and converter options patch

2008-08-29 Thread Chris Cruft
the source data comes from and how it is stored. I've got to mull this one over now... -Chris On Aug 28, 9:23 am, Manfred Stienstra <[EMAIL PROTECTED]> wrote: > On Aug 28, 2:03 pm, Chris Cruft <[EMAIL PROTECTED]> wrote: > > > I looked at the proposed attribute-decora

[Rails-core] Re: composed_of constructor and converter options patch

2008-08-28 Thread Chris Cruft
I looked at the proposed attribute-decorator plugin a bit and found it pretty simple. But (assuming I understood it) the simplicity comes with a noticeable penalty for the use case where you want to use a standard class for the decorator that does not include a parse factory method: another wrapp

[Rails-core] Re: composed_of constructor and converter options patch

2008-08-26 Thread Chris Cruft
Rob, I like your patch: it solves problems I have had and the aesthetics of a proc feel right. But the duplication between the constructor code and the converter code is not DRY. Why not just lump them together into :constructor? By providing the option to use a proc, you've already addressed t

[Rails-core] Re: coercions of blank strings to boolean and integer values

2008-08-21 Thread Chris Cruft
further to coerce booleans using external logic. It's the use of external logic that I characterized as "guessing." -Chris On Aug 20, 6:47 pm, "Damian Janowski" <[EMAIL PROTECTED]> wrote: > On Wed, Aug 20, 2008 at 12:34 PM, Chris Cruft <[EMAIL PROTECTED]> wrote

[Rails-core] Re: coercions of blank strings to boolean and integer values

2008-08-20 Thread Chris Cruft
n. It's all downhill from here... Of course it's worth considering combining the Reverse Presenter and the classic Presenter into one class. That might help with building some enthusiasm for the idea and it would probably reduce the amount of modeling required. On Aug 19, 12:23 pm

[Rails-core] Re: coercions of blank strings to boolean and integer values

2008-08-19 Thread Chris Cruft
The scenario that you mention is a classic one of empty strings being returned from forms. And the problem is bigger than just booleans. It also applies to strings, numbers and lists. In the scenario Josh mentions, a boolean field should have the empty string or a blank string coerced to false

[Rails-core] Re: timestamped migrations

2008-07-12 Thread Chris Cruft
Last time I checked (OK, several months ago), every migration file IS loaded for any migration.. On Jul 11, 8:46 pm, "Nik Wakelin" <[EMAIL PROTECTED]> wrote: > (I haven't looked at the code; would this require loading every > migration every time you want to migrate?). > --~--~-~--~~

[Rails-core] Re: ActionController for Resources

2008-07-11 Thread Chris Cruft
Yes, we did. You might also say that I badgered you about Full-circle REST... On Jul 10, 8:02 am, "Michael Koziarski" <[EMAIL PROTECTED]> wrote: ... > > "Full Circle REST" is where it's at. > > Definitely, and I think we've discussed this previously on #rails-contrib? > ... --~--~-~--~--

[Rails-core] Re: ActionController for Resources

2008-07-10 Thread Chris Cruft
Have a look at Resources Controller (RC) plugin, which is a pretty mature and functional set of functionality for getting the relevant resources for a controller. RC is strong -I gave up my own solution to adopt RC (and contribute a bit). Ian White, the author, has really kept it going. http://

[Rails-core] Re: Association preload quoting fix.

2008-04-25 Thread Chris Cruft
Any progress on the patch to fix the integer key assumption in the same code? -Chris On Apr 25, 3:31 am, Frederick Cheung <[EMAIL PROTECTED]> wrote: > I tidied up some association preload stuff where it wasn't quoting   > table names if anyone wants to take a > look:http://rails.lighthouseapp.c

[Rails-core] Re: Polymorphic resources enhancement review request

2008-03-07 Thread Chris Cruft
Antonio, I agree that doing something like "edit_post_asset_path(@event, @movie) is nice. But, again, you don't need to put syntax on routes to achieve nearly the same effect. As one example, consider the ResourcesController (RC) plugin which provides helpers like... edit_resource_path The ide

[Rails-core] Re: Polymorphic resources enhancement review request

2008-03-06 Thread Chris Cruft
Wildchild, Your patch takes an approach that differs from the one taken by the ResourcesController plugin. I like the RESULT of your patch (:*_type key in the params) but, as shown by the RC plugin, I'm not sure the specification with :polymorphic => is required or wise. Right now, there is a l

[Rails-core] Seeking support for patch adding "replace" to HasManyThroughAssociation

2008-02-25 Thread Chris Cruft
h my patch (failing tests included) posted on this ticket: http://dev.rubyonrails.org/ticket/11040 Please take a look and consider supporting this patch. ...and we thank you for your support. -Chris Cruft --~--~-~--~~~---~--~~ You received this message because

[Rails-core] Re: Found bug, wrote patch. Need help with failing test.

2008-01-25 Thread Chris Cruft
Thanks Michael. I did just that and Ben Scofield pointed me in the right direction. Can I get a +1? -Chris On Jan 24, 10:58 pm, "Michael Koziarski" <[EMAIL PROTECTED]> wrote: > > But I am having a tough time writing a failing test. It seems as > > though TestRequest does not implement the get

[Rails-core] Found bug, wrote patch. Need help with failing test.

2008-01-22 Thread Chris Cruft
There is a bug in the AbstractRequest getter/setter combo for the format. It was introduced in changeset 7479 a couple of months ago. It has escaped detection so far because the "respond_to |format|" circumvents it. The bug is trivial to understand and fix. Understanding: Assuming the request

[Rails-core] Re: polymorphic_urls and REST routes

2008-01-22 Thread Chris Cruft
My hero! On Jan 21, 9:19 am, "Mislav Marohnić" <[EMAIL PROTECTED]> wrote: > I've already fixed it, just need to make unit tests and finish the > documentation. Then I'll submit it in one big patch. > > 2008/1/21 Chris Cruft <[EMAIL PROTECTED]>: > &g

[Rails-core] Re: Polymorphic URL helpers documentation and fixes

2008-01-22 Thread Chris Cruft
I'm frequently in need of generating a formatted polymorphic url. Currently, it's done ugly because the formatted_polymorphic_url code is broken (see ticket 8782 and Mislav's #2 above). I would like to see that helper working-but if the job can be done with something simpler, I'm all for it. Tre

[Rails-core] Re: polymorphic_urls and REST routes

2008-01-21 Thread Chris Cruft
Mislav, Can you suggest how to do the exact same thing with formatted URLs? Using adish's example, something using a helper like edit_formatted_polymorphic_path(record, :xml) This seems logical, but is busted in Edge (see http://dev.rubyonrails.org/ticket/8782). -Chris On Jan 20, 11:53 am,

[Rails-core] Re: Comments requested

2008-01-14 Thread Chris Cruft
This seems so obvious that I gotta believe its somewhere in the code already. If it is not, a definite +1 for the idea and I will try to test your code. On Jan 13, 1:42 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Hi all, > > I submitted a patch a couple of days ago that makes it possibl

[Rails-core] Re: Rake tasks for development and testing

2007-12-08 Thread Chris Cruft
I've tried to adopt DHH's approach of using migrations just as a change agent and relying on the schema dumper to reveal the state. What I've found lacking in this approach is that the schema dumper shows the current schema state AS IS, not AS INTENDED. I'm not perfect in my practices, and perhap

[Rails-core] Re: Fixtures Cleanup

2007-12-03 Thread Chris Cruft
FWIW, the Globalize plugin uses CSV files for it's (substantial) fixtures. It is much easier to read and scan 3000 columnar fixtures than the equivalent YAML encoding. For small volumes, I have no need for anything but YAML. For large volumes, CSV is nice. On Dec 2, 8:36 pm, DHH <[EMAIL PROT

[Rails-core] Re: Rake tasks for development and testing

2007-12-01 Thread Chris Cruft
"...migrations are transient artifacts that only serve the purpose of moving everyone on a schema version A to schema version B." David, Koz expressed almost exactly this same sentiment yesterday in another thread (http://groups.google.com/group/rubyonrails-core/browse_frm/ thread/d871469cb2a6589

[Rails-core] Re: Rake tasks for development and testing

2007-11-30 Thread Chris Cruft
I'm not sure I exactly follow Robert's use cases, but I sympathize with the frustration with schema.rb versus migrations. Check out this thread for a similar discussion: http://groups.google.com/group/rubyonrails-core/t/d871469cb2a6589a?hl=en The highly-specific use cases for Robert's patch wil

[Rails-core] Re: db/schema.rb

2007-11-30 Thread Chris Cruft
>>"You run your migrations against your development database, it's hardly as >>bad as you're implying :)." True, but... In development, you run the new migrations -you don't typically tear down the DB and run all of them from the start. Consequently, older migrations become stale and broken (

[Rails-core] Re: db/schema.rb

2007-11-29 Thread Chris Cruft
Josh's rake task looks like it provides a nice ability to load data via Rake. But there is an inconsistent message being sent by Rails: Use Migrations. Use Migrations. Use Migrations. Except for testing, where we'll use a limited, one-off method (schema dumper) ensuring that you'll never know

[Rails-core] Re: tztime plugin resaving bug w/ fix

2007-11-27 Thread Chris Cruft
I'll try to review it today. In any case, it seems like a bug that will irreversibly corrupt your data. This ticket should be getting serious attention for that reason alone. -Chris On Nov 19, 1:00 am, Tim Lucas <[EMAIL PROTECTED]> wrote: > Not sure what Jamis is up to, but just in case this f

[Rails-core] Re: db/schema.rb

2007-11-14 Thread Chris Cruft
Michael, Please see me earlier comment and see ticket 8389 -that's the patch for a task to support migration-based building of the test database. -Chris On Nov 14, 12:29 am, "Michael Koziarski" <[EMAIL PROTECTED]> wrote: > > 1 ) What, then, is the preferred mechanism for "seed" data in the > >

[Rails-core] Re: db/schema.rb

2007-11-14 Thread Chris Cruft
Stephen, Your questions are a mirror of mine. I am surprised that the emphasis placed on migrations for building the development and production databases does not extend to the test database. There is a rake task proposed on ticket 8389 (http:// dev.rubyonrails.org/ticket/8389) that addresses th

[Rails-core] Re: schema.rb lacks ENGINE and CHARSET

2007-11-10 Thread Chris Cruft
Greg, Considering the shortcomings in the :ruby schema builder, I'm surprised that anyone with legacy issues would consider it all: deviations in primary key structure or name, foreign key constraints, table types -you name it and the :ruby schema builder can't handle it. I'm OK with that because

[Rails-core] Re: Need verification of a TINY AR patch

2007-10-23 Thread Chris Cruft
Thanks to those of you that have tested the patch -but I still need one more tester! Someone. Please. On Oct 22, 8:47 am, Chris Cruft <[EMAIL PROTECTED]> wrote: > I would appreciate it if you could verify this AR patch on ticket > 9843. In a nutshell, it corrects the beh

[Rails-core] Need verification of a TINY AR patch

2007-10-22 Thread Chris Cruft
I would appreciate it if you could verify this AR patch on ticket 9843. In a nutshell, it corrects the behavior of the composed_of aggregation in the presence of nil values. This patch, in various forms, has been submitted by THREE different authors. This time I put a failing test case in place

[Rails-core] Re: Nil assignment doesn't result in nil aggregate object

2007-10-13 Thread Chris Cruft
It probably would have helped if I had mentioned the new ticket: It is ticket #9843 http://dev.rubyonrails.org/ticket/9843 -Chris On Oct 12, 10:05 am, Chris Cruft <[EMAIL PROTECTED]> wrote: > Looking for love for my patch correcting behavior of composed_of with > allow_nil =&

[Rails-core] Nil assignment doesn't result in nil aggregate object

2007-10-12 Thread Chris Cruft
Looking for love for my patch correcting behavior of composed_of with allow_nil => true. This patch, in various forms from various authors, has been around for over a year. It has never been accepted into core due to a lack of tests. Well, I've now added the failing tests and the patch against

[Rails-core] Re: Beginnings of a i18n plugin agnostic api for rails edge

2007-10-04 Thread Chris Cruft
Julian has noted disatisfaction with string keys, but I suspect he didn't use a dummy language... I'm a big believer that the "dummy language" approach is very effective. While the concept's name leaves a bit of a sour taste in your mouth ('dummy'), the concept provides a great ability to segreg

[Rails-core] Re: Hatred towards Nested Polymorphic Paths

2007-08-03 Thread Chris Cruft
Some people use the concept of resource nesting or "belongs to" to manage security, but it is pretty one-dimensional. More robust security systems (role-based access control, for example) have a much richer concept of authorization than could possibly be expressed in a request string. I love nes

[Rails-core] Re: after_initialize/after_find misfeature

2007-07-25 Thread Chris Cruft
I recall hearing the Holy Beasts of Doom argument for overriding new - but not for initialize. I've been using something like Piers' approach, which has always worked for me: def initialize(attrs = {}, &block) super attrs.reverse_merge(default_attributes_hash), &block more_initialization_dep

[Rails-core] Re: db:fixtures:load order

2007-07-25 Thread Chris Cruft
tem, I'd just like a way to > load the fixtures like they are currently loaded but do it once > and only once for all tests. > > btw. Nested transactions would not necessarily be required for a mixed > system, but you would have to reload the per-test fixtures after each > transacti

[Rails-core] Re: db:fixtures:load order

2007-07-23 Thread Chris Cruft
Tarmo's proposal of having two classes of fixtures (pre-loaded before all tests, and per-test fixtures) seems very smart. It would also ease the transition from the current per-test approach. For performance reasons, wouldn't such an approach require nested transactions? Not that nested transac

[Rails-core] Re: Hatred towards Nested Polymorphic Paths

2007-07-08 Thread Chris Cruft
Josh, I grok what Daniel is trying to say, but I can't tell if you do or not. Perhaps this will help. /mother/273753/child/234 /father/342986/child/234 /child/234 In all of those URLs it is very clear which single resource we are referencing: Child 234. But the URLs give very different context

[Rails-core] Re: Hatred towards Nested Polymorphic Paths

2007-07-08 Thread Chris Cruft
Josh Writes: >"/companies/1/people/1" == BAD >"/people/1" == GOOD > >I have no problem with nested collections. > >"/companies/1/people" > >You shouldn't need to be scoping person #1 if its the unique id. But isn't that the rub? Who says the ids must be unique? True, Rails support for composit

[Rails-core] Re: Limitations of :conditions on associations

2007-07-05 Thread Chris Cruft
I've run into problems trying to anticipate the aliased table name as well. I think Rails should have a more consistent way to refer to aliased table names. Perhaps a parameter to the association definition? class Employee < AR::Base ... has_many :subordinates, :class_name => 'Employee', :s

[Rails-core] Re: assert_template... what's the reasoning for looking at the first rendered file?

2007-06-14 Thread Chris Cruft
I've wrestled with the same problem. I first render one of several templates to a string, then include the string within a rendered template. And my testing breaks (or at least is counter-intuitive) as well. It certainly doesn't seem right that rendering to a string dominates (assert_template-w

[Rails-core] Re: assert_template... what's the reasoning for looking at the first rendered file?

2007-06-14 Thread Chris Cruft
I've wrestled with the same problem. I first render one of several templates to a string, then include the string within a rendered template. And my testing breaks (or at least is counter-intuitive) as well. It certainly doesn't seem right that rendering to a string dominates (assert_template-w

[Rails-core] Re: Localization of Rails core

2007-05-23 Thread Chris Cruft
Why not have RoR define a reference set of modules and class (call it i18n for now) whose API implements the most basic i18n methods with no real functionality? Then the plugins could flesh out the functionality. I know this is pretty simplistic, but we need to start somewhere. As RoR evolves,