[Rails] Re: Check if within a transaction?

2011-03-19 Thread Michael Schuerig
to use transaction(:requires_new = true). Michael -- Michael Schuerig mailto:mich...@schuerig.de http://www.schuerig.de/michael/ -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email to rubyonrails-talk

[Rails] Re: problem in using xsendfile apche+mongrel

2010-09-27 Thread Michael Schuerig
that the Rails process does not respond with the file itself. Instead, Rails sets a special header which in turn is picked up by Apache (or nginx, lighttpd) and interpreted in such a way that it now serves the named file. Michael -- Michael Schuerig mailto:mich...@schuerig.de http

[Rails] Re: Maintain connections to two databases

2010-09-22 Thread Michael Schuerig
objects) are re-initialized again, too. Among those being the variables that hold the database connection. Michael -- Michael Schuerig mailto:mich...@schuerig.de http://www.schuerig.de/michael/ -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group

[Rails] Re: Maintain connections to two databases

2010-09-21 Thread Michael Schuerig
else might cause it to drop the transaction). Michael -- Michael Schuerig mailto:mich...@schuerig.de http://www.schuerig.de/michael/ -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email to rubyonrails-t

[Rails] Re: Maintain connections to two databases

2010-09-21 Thread Michael Schuerig
to investigate the reason. Usually, class caching is enabled there and connections are retained across requests. Another angle of attack is to set a breakpoint (or puts caller) somewhere deep down in the database adapter to see when and from where connections are established. Michael -- Michael

[Rails] Re: Postgresql RETURNING statement - returning and ID after writing to a DB

2010-09-18 Thread Michael Schuerig
interested in the details, read the code in gem dir/activerecord-3.0.0/lib/active_record/connection_adapters/postgresql_adapter.rb Michael -- Michael Schuerig mailto:mich...@schuerig.de http://www.schuerig.de/michael/ -- You received this message because you are subscribed to the Google Groups Ruby

[Rails] Re: Bundler for Rails 3 Engine

2010-09-17 Thread Michael Schuerig
in a gemspec. Michael -- Michael Schuerig mailto:mich...@schuerig.de http://www.schuerig.de/michael/ -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe

[Rails] Re: including a module in my model rails 3

2010-09-17 Thread Michael Schuerig
. Michael -- Michael Schuerig mailto:mich...@schuerig.de http://www.schuerig.de/michael/ -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from this group

[Rails] Re: OT: Installing static binary of wkhtmltopdf

2010-09-15 Thread Michael Schuerig
package for that. Michael -- Michael Schuerig mailto:mich...@schuerig.de http://www.schuerig.de/michael/ -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe

[Rails] Re: OT: Installing static binary of wkhtmltopdf

2010-09-15 Thread Michael Schuerig
who introduced this extension of the original i386/IA-32 architecture. See http://en.wikipedia.org/wiki/X86-64 . And have look at the output of uname -a. Michael -- Michael Schuerig mailto:mich...@schuerig.de http://www.schuerig.de/michael/ -- You received this message because you

[Rails] Re: How would I set up a Rails-style Public dir in a Gem?

2010-09-15 Thread Michael Schuerig
or nginx are much faster at serving static files than Rails proper would be. I take it, the usual way to add assets from a gem is to include a generator that copies (or links) these assets to the application's public directory. Michael -- Michael Schuerig mailto:mich...@schuerig.de http

[Rails] Using URLs as resource IDs: how to make work with Apache/Passenger?

2010-09-14 Thread Michael Schuerig
, even though they are encoded as %2F. I'd prefer if I didn't have to read through all the ActionPack and Rack routing code to understand what's happening and find a remedy. It must be possible to do this cleanly. Michael -- Michael Schuerig mailto:mich...@schuerig.de http://www.schuerig.de

[Rails] Re: Using URLs as resource IDs: how to make work with Apache/Passenger?

2010-09-14 Thread Michael Schuerig
On Tuesday 14 September 2010, Jeremy Kemper wrote: On Tue, Sep 14, 2010 at 11:13 AM, Michael Schuerig mich...@schuerig.de wrote: [...] There is nothing in the app's log. The problem appears to be caused by the / in the :url parameter, even though they are encoded as %2F. I'd prefer

[Rails] Re: Rails 3: finding a record by name in multilingual app

2010-09-13 Thread Michael Schuerig
-- Michael Schuerig mailto:mich...@schuerig.de http://www.schuerig.de/michael/ -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email

[Rails] Re: after_create not being called in seeds.rb?

2010-09-13 Thread Michael Schuerig
Michael -- Michael Schuerig mailto:mich...@schuerig.de http://www.schuerig.de/michael/ -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send

[Rails] Re: Rails 3: finding a record by name in multilingual app

2010-09-13 Thread Michael Schuerig
(or flabberghastly, depending on how you look at it). Anyway, I think(!) you get what you want, if you simply write with_locale(:en) { Page.find_by_name('Welcome') } For more details, have a look at the tests that come with globalize3. Michael -- Michael Schuerig mailto:mich...@schuerig.de http

[Rails] Resource routes: optional path components

2010-09-12 Thread Michael Schuerig
. Is there another solution that doesn't involve overwriting and makes resources generate the size routes? One important constraint is that I need the :size option on #image_path; it would not help to have additional routes with different names. Michael -- Michael Schuerig mailto:mich...@schuerig.de

[Rails] Re: Resource routes: optional path components

2010-09-12 Thread Michael Schuerig
. Michael -- Michael Schuerig mailto:mich...@schuerig.de http://www.schuerig.de/michael/ -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from this group

[Rails] Re: rails 3 backends

2010-09-10 Thread Michael Schuerig
. Michael -- Michael Schuerig mailto:mich...@schuerig.de http://www.schuerig.de/michael/ -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from this group

[Rails] Re: Will a Quad-core i5 processor significantly speed up development on Linux or Mac?

2010-09-09 Thread Michael Schuerig
purposes, there probably isn't a noticeable speed difference between a 2.4GHz dual core and a quad core of the same generation; 4GB RAM is the minimum; see if you can try out how an SSD affects speed (and tell us about your experience). Michael -- Michael Schuerig mailto:mich...@schuerig.de http

[Rails] Re: Objects with versions: how to avoid 1 + n queries?

2010-09-07 Thread Michael Schuerig
On Tuesday 07 September 2010, Marnen Laibow-Koser wrote: Michael Schuerig wrote: I am still considering a better solution for your problem, though I'll admit that the spirit in which my attempts have so far been received is not exactly encouraging me to spend much more time on the issue

[Rails] Re: Objects with versions: how to avoid 1 + n queries?

2010-09-04 Thread Michael Schuerig
-- and ignorant. You don't have to answer every question in this mailing list single-handedly. Anyway, I'm still looking for a way to express the existing, working SQL solutions (sub-select for the latest version corresponding to an article) in elegant ActiveRecord code. Michael -- Michael Schuerig

[Rails] Re: Objects with versions: how to avoid 1 + n queries?

2010-09-04 Thread Michael Schuerig
On Saturday 04 September 2010, Colin Law wrote: On 4 September 2010 09:14, Michael Schuerig mich...@schuerig.de wrote: On Friday 03 September 2010, Marnen Laibow-Koser wrote: Marnen Laibow-Koser wrote: Well, you learn something new every day! I found the Ambiguous Groups article

[Rails] Re: Objects with versions: how to avoid 1 + n queries?

2010-09-03 Thread Michael Schuerig
On Friday 03 September 2010, Marnen Laibow-Koser wrote: Michael Schuerig wrote: On Friday 03 September 2010, Marnen Laibow-Koser wrote: On further reflection, I don't know why you would need an outer join unless not every Article has a Version associated. Is that the case? I need

[Rails] Objects with versions: how to avoid 1 + n queries?

2010-09-02 Thread Michael Schuerig
: correlated subqueries? -- Michael Schuerig mailto:mich...@schuerig.de http://www.schuerig.de/michael/ -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from

[Rails] Re: Objects with versions: how to avoid 1 + n queries?

2010-09-02 Thread Michael Schuerig
On Friday 03 September 2010, Michael Pavling wrote: On 2 September 2010 22:49, Michael Schuerig mich...@schuerig.de wrote: Firstly, I've asked a similar question before[*]. I didn't get any answers back then, maybe now I have better luck It's hard to answer your post, as your only

[Rails] Re: Objects with versions: how to avoid 1 + n queries?

2010-09-02 Thread Michael Schuerig
On Friday 03 September 2010, Marnen Laibow-Koser wrote: Michael Schuerig wrote: Firstly, I've asked a similar question before[*]. I didn't get any answers back then, maybe now I have better luck Let's say I have models like this class Article ActiveRecord::Base

[Rails] Re: Objects with versions: how to avoid 1 + n queries?

2010-09-02 Thread Michael Schuerig
On Friday 03 September 2010, Marnen Laibow-Koser wrote: I had a couple more ideas just after I posted. Marnen Laibow-Koser wrote: Michael Schuerig wrote: [...] :joins with a symbol does an inner join. So use an SQL fragment if you need an outer join (which, on reflection, I

[Rails] Re: Thinking of going back to MySql from PgSql. Your thoughts?

2010-09-01 Thread Michael Schuerig
. Their default configurations are meant to work, but are in no ways optimized for what you might be doing with your databases. Michael -- Michael Schuerig mailto:mich...@schuerig.de http://www.schuerig.de/michael/ -- You received this message because you are subscribed to the Google Groups Ruby

[Rails] Re: Views: comments for template and partial location in filesystem?

2010-09-01 Thread Michael Schuerig
On Wednesday 01 September 2010, Marnen Laibow-Koser wrote: Michael Schuerig wrote: I'm looking for an extension (gem, plugin, whatever) that inserts comments like !-- begin partial app/views/things/_thing.html.erb --% ... !-- end partial app/views/things/_thing.html.erb

[Rails] How to properly define constants in helpers?

2010-08-30 Thread Michael Schuerig
initialized constant DEFAULT_OPTIONS Is there anything I can do about this warning? Michael -- Michael Schuerig mailto:mich...@schuerig.de http://www.schuerig.de/michael/ -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group

[Rails] Re: How to properly define constants in helpers?

2010-08-30 Thread Michael Schuerig
loadable', :before = action_controller.set_configs do |app| paths.app.helpers.each do |path| app.paths.app.helpers path end end and unfortunately, that in some way appears to cause the warning. Michael -- Michael Schuerig mailto:mich...@schuerig.de http://www.schuerig.de/michael

[Rails] Re: Ruby on Rails IDE

2010-08-25 Thread Michael Schuerig
On Wednesday 25 August 2010, Bill Walton wrote: Sorry to jump in mid-stream here, but On Aug 25, 12:29 am, Michael Schuerig mich...@schuerig.de wrote: Last week! I just found it too big and bloated for Rails needs Make sure you're using the Ruby-only version of NB unless you really

[Rails] Re: Ruby on Rails IDE

2010-08-25 Thread Michael Schuerig
On Wednesday 25 August 2010, Bill Walton wrote: On Wed, Aug 25, 2010 at 3:22 PM, Michael Schuerig mich...@schuerig.de wrote: My ~/.netbeans/6.9 directory has grown to an amazing 856MB, largely consisting of downloaded updates, I reckon. Ouch. OTOH, that's like $0.10 worth of storage now

[Rails] Multiple joins to the same table/association with different conditions

2010-08-25 Thread Michael Schuerig
-- Michael Schuerig mailto:mich...@schuerig.de http://www.schuerig.de/michael/ -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email

[Rails] Re: Ruby on Rails IDE

2010-08-24 Thread Michael Schuerig
, particularly RadRails/Studio for Rails 3, had still many problems of their own, last time I looked. Michael -- Michael Schuerig mailto:mich...@schuerig.de http://www.schuerig.de/michael/ -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group

[Rails] send_file with temporary files -- how to delete file after sending?

2010-08-20 Thread Michael Schuerig
sending the file. I'm using apache 2.2 and mod_xsendfile 0.9. Michael -- Michael Schuerig mailto:mich...@schuerig.de http://www.schuerig.de/michael/ -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email

[Rails] Deployment: adding git tag as HTML meta tag

2010-08-10 Thread Michael Schuerig
=v1.1.42 deploy Are there reasons not to do this or not to do it this way? I don't think there is a security problem of exposing to many details about the app as it is only for internal use. Michael -- Michael Schuerig mailto:mich...@schuerig.de http://www.schuerig.de/michael/ -- You received

[Rails] Re: Deployment: adding git tag as HTML meta tag

2010-08-10 Thread Michael Schuerig
On Tuesday 10 August 2010, Parker Selbert wrote: Michael Schuerig wrote: I'd like to be able to see from generated pages which version of the app has generated it. As we're using git and always deploy a specific tag, having that tag in the HTML head as a meta tag would be suitable

[Rails] Re: Deployment: adding git tag as HTML meta tag

2010-08-10 Thread Michael Schuerig
On Tuesday 10 August 2010, Marnen Laibow-Koser wrote: Michael Schuerig wrote: [...] I didn't explain why I want this version number to begin with. I don't need the version anywhere in the app. The whole point is to identify the version of the app that has generated a page. So, if I get

[Rails] Re: Deployment: adding git tag as HTML meta tag

2010-08-10 Thread Michael Schuerig
On Tuesday 10 August 2010, Parker Selbert wrote: Michael Schuerig wrote: I don't see where security would be an issue here, but reusability may be. A more generic VERSION file that can be loaded and read from would be available anywhere in your application, and could be simpler

[Rails] Re: Deployment: adding git tag as HTML meta tag

2010-08-10 Thread Michael Schuerig
On Tuesday 10 August 2010, Marnen Laibow-Koser wrote: Michael Schuerig wrote: On Tuesday 10 August 2010, Marnen Laibow-Koser wrote: Then, instead of a meta tag, why not just put it in a hidden (or smallish) div in the HTML? Why? I don't see what I would gain. If it's not hidden

[Rails] Re: Deployment: adding git tag as HTML meta tag

2010-08-10 Thread Michael Schuerig
On Tuesday 10 August 2010, Marnen Laibow-Koser wrote: Michael Schuerig wrote: [...] Trust me, I'm not overwriting anything. Yes, I wrote so originally, but that was only for easier explanation. When I had to go into the details, I clarified that I'm not overwriting, but rather

[Rails] Re: Deployment: adding git tag as HTML meta tag

2010-08-10 Thread Michael Schuerig
On Tuesday 10 August 2010, Parker Selbert wrote: Michael Schuerig wrote: Capistrano already writes a REVISION file containing the commit sha1. Let's assume there's a TAG file, too. Then an initializer like this would do the job if Rails.env.production? version = File.read('TAG

[Rails] Re: Juggernaut Rails 3

2010-08-04 Thread Michael Schuerig
to the core implementation, but mostly to the packaging (plugin, engine) and integration with ActionView. The server itself doesn't depend on Rails, AFAICT, so it wouldn't be affected by version changes. Michael -- Michael Schuerig mailto:mich...@schuerig.de http://www.schuerig.de/michael

[Rails] Re: Rails 3 RC

2010-07-26 Thread Michael Schuerig
On Monday 26 July 2010, Ryan Bigg wrote: Michael Schuerig wrote: On Monday 26 July 2010, Ryan Bigg wrote: As for the people who aren't good for this community, I so far see two of them in this entire thread and let me tell you: they aren't the people who are whining that Rails 3 isn't out

[Rails] Re: Rails 3 RC

2010-07-25 Thread Michael Schuerig
they should leave? To get an idea of the impact that certain people leaving would have on the community, I suggest writing a script to count the number of contributions to the mailing list that the people involved in this thread have made over the years. Michael -- Michael Schuerig mailto:mich

[Rails] Renderer: rendering to *another* format inside a renderer

2010-07-03 Thread Michael Schuerig
. Is there a *clean* way to make render_to_string do what I want? Michael -- Michael Schuerig mailto:mich...@schuerig.de http://www.schuerig.de/michael/ -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email

[Rails] Re: Renderer: rendering to *another* format inside a renderer

2010-07-03 Thread Michael Schuerig
On Saturday 03 July 2010, Marnen Laibow-Koser wrote: Michael Schuerig wrote: My skeletal renderer looks like this ActionController.add_renderer :pdf do |template, options| html = render_to_string(template, options) ... end The trouble here

[Rails] Debugging a Rails 3 app with RadRails 2?

2010-06-20 Thread Michael Schuerig
/rdebug-ide:87 /var/lib/gems/1.8/bin/rdebug-ide:19:in `load' /var/lib/gems/1.8/bin/rdebug-ide:19 -e:3:in `load' -e:3 Uncaught exception: uninitialized constant Debugger::CommandProcessor -- Michael Schuerig mailto:mich...@schuerig.de http://www.schuerig.de/michael

[Rails] ActiveRecord and ARel: correlated subqueries?

2010-06-20 Thread Michael Schuerig
= Article.with_latest_version article[i].version is intended to be the latest version. Works nicely in 2.3.8, but in 3.beta4 it breaks down somewhere when ARel somewhere deep down doesn't remember anymore that there is a :version association. Michael -- Michael Schuerig mailto:mich...@schuerig.de http

[Rails] Re: Rails Authorization plugins

2010-05-02 Thread Michael Schuerig
with the restul_auth plugin btw. Have you had a look at authlogic for comparison? Michael -- Michael Schuerig mailto:mich...@schuerig.de http://www.schuerig.de/michael/ -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email

[Rails] Re: [Rails 2.3] Adding a phase to the ActiveRecord Lifecycle

2010-04-14 Thread Michael Schuerig
on all the validates_something methods. Michael -- Michael Schuerig mailto:mich...@schuerig.de http://www.schuerig.de/michael/ -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email to rubyonrails-t

[Rails] Re: Most popular IDEs for Ruby on Rails development

2010-03-12 Thread Michael Schuerig
. Eclipse/Aptana and Textmate do this exceptionally well, I haven't found this functionality in a similarly easy and quick way in Emacs. It might be hidden somewhere, please point it out in case I just didn't find it. Michael -- Michael Schuerig mailto:mich...@schuerig.de http

[Rails] Re: Most popular IDEs for Ruby on Rails development

2010-03-12 Thread Michael Schuerig
On Friday 12 March 2010, Greg Donald wrote: On Fri, Mar 12, 2010 at 10:04 AM, Michael Schuerig mich...@schuerig.de wrote: http://static.destiney.com/emacs_screen_shot.jpg There's one feature I've been missing in Emacs: There are only missing features until you add them. http

[Rails] Re: View Helper Scope

2010-02-02 Thread Michael Schuerig
On Tuesday 02 February 2010, Marnen Laibow-Koser wrote: Michael Schuerig wrote: On Monday 01 February 2010, Marnen Laibow-Koser wrote: strings. Let's just leave it at that and acknowledge that our views differ. I really would rather not leave it there. If I'm doing things the wrong

[Rails] Re: View Helper Scope

2010-02-01 Thread Michael Schuerig
On Monday 01 February 2010, Marnen Laibow-Koser wrote: Michael Schuerig wrote: On Sunday 31 January 2010, Marnen Laibow-Koser wrote: If you only include specific helper modules, you can have multiple methods with the same name, but different implementations. This can be useful in order

[Rails] Re: View Helper Scope

2010-02-01 Thread Michael Schuerig
On Monday 01 February 2010, Marnen Laibow-Koser wrote: Michael Schuerig wrote: [...] What's the point of helper polymorphism? I'm having trouble coming up with a good use case for it. format_value, cancel_link are just two examples where generic names are perfectly understandable

[Rails] Re: View Helper Scope

2010-02-01 Thread Michael Schuerig
that our views differ. If you don't already know them for a long time, you might enjoy Allen Holub's old JavaWorld articles on UI construction. http://holub.com/publications/articles/index.html#javaworld Michael -- Michael Schuerig mailto:mich...@schuerig.de http://www.schuerig.de/michael/ -- You

[Rails] Re: View Helper Scope

2010-01-31 Thread Michael Schuerig
-- Michael Schuerig mailto:mich...@schuerig.de http://www.schuerig.de/michael/ -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email

[Rails] Re: View Helper Scope

2010-01-31 Thread Michael Schuerig
On Sunday 31 January 2010, Marnen Laibow-Koser wrote: Michael Schuerig wrote: [...] Helpers are procedural by nature. helper :all drives out the last bit of polymorphism there was. Why do you say that? I don't understand, except to the extent that Rails views are sort of procedural

[Rails] Re: View Helper Scope

2010-01-31 Thread Michael Schuerig
On Sunday 31 January 2010, Marnen Laibow-Koser wrote: Michael Schuerig wrote: On Sunday 31 January 2010, Marnen Laibow-Koser wrote: Michael Schuerig wrote: [...] Helpers are procedural by nature. helper :all drives out the last bit of polymorphism there was. Why do you say

[Rails] Use the source, dude (was: uniqueness validation perplexity)

2009-09-26 Thread Michael Schuerig
making this suggestion every once in a while and usually the reaction is not particularly heartfelt. Anyway, don't take this personally, see it as an invitation, not an exhortation. Michael -- Michael Schuerig mailto:mich...@schuerig.de http://www.schuerig.de/michael

[Rails] Re: Monitor Size Problem ..

2009-08-17 Thread Michael Schuerig
of the client machine. Use it to render various versions of your page. Here's how I've done a thing like that in the past http://www.schuerig.de/michael/blog/index.php/2007/02/22/size-dependent- layout/ HTH, Michael -- Michael Schuerig mailto:mich...@schuerig.de http://www.schuerig.de/michael

[Rails] Re: Json views

2009-08-04 Thread Michael Schuerig
On Tuesday 04 August 2009, Nicholas Wieland wrote: Il giorno 03/ago/09, alle ore 20:10, Michael Schuerig ha scritto: On Monday 03 August 2009, Nicholas Wieland wrote: Hi *, I'm writing an API for my application, but I can't figure out how to behave with the json frontend, where I need

[Rails] Re: Json views

2009-08-03 Thread Michael Schuerig
of problems ? In case you decide that JSON views are what you want, have a look at a (trivial) template handler I wrote to help with just that http://github.com/mschuerig/ruby_template_handler Michael -- Michael Schuerig mailto:mich...@schuerig.de http://www.schuerig.de/michael

[Rails] Re: Model with two Value Object associations

2009-07-25 Thread Michael Schuerig
(shipping_address_id_was) if shipping_address_id_was end # same for billing_address; better extract the common code end end The code probably won't work as is, but it might get you started. Also, have a look at the :autosave option for belongs_to. HTH, Michael -- Michael Schuerig mailto:mich

[Rails] Re: Model with two Value Object associations

2009-07-25 Thread Michael Schuerig
the after_save callback is invoked? That was my concern when I suggested using a before_save callback in a parallel post. Michael -- Michael Schuerig mailto:mich...@schuerig.de http://www.schuerig.de/michael/ --~--~-~--~~~---~--~~ You received this message because

[Rails] Re: How to dynamically change stylesheets globally?

2009-07-16 Thread Michael Schuerig
and and add the appropriate classes to your style rules. Michael -- Michael Schuerig mailto:mich...@schuerig.de http://www.schuerig.de/michael/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group

[Rails] Re: How to dynamically change stylesheets globally?

2009-07-16 Thread Michael Schuerig
, but for the style-switching, you can make them completely static, i.e., they can be served by the web server without any processing by Rails. Michael -- Michael Schuerig mailto:mich...@schuerig.de http://www.schuerig.de/michael/ --~--~-~--~~~---~--~~ You received

[Rails] Re: Reading AR validations at runtime

2009-07-15 Thread Michael Schuerig
On Wednesday 15 July 2009, Will Grundler wrote: Does anyone, by chance, know how to obtain a list of all the defined activerecord validations at runtime? http://rubyforge.org/projects/valirefl/ http://github.com/mschuerig/validation_reflection/tree/master HTH, Michael -- Michael Schuerig

[Rails] Re: ActiveRecord, PostgreSQL question

2009-07-10 Thread Michael Schuerig
/ruby-flv-pseudostreaming- implemented-using-sinatra-and-rack-evil-useful-for-rails-too/ Michael -- Michael Schuerig mailto:mich...@schuerig.de http://www.schuerig.de/michael/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

[Rails] Re: Rails with composite primary keys and string keys

2009-06-22 Thread Michael Schuerig
a lot of code out there, plugins specifically, to tacitly assume that ids are plain numbers or can converted to numbers. Michael -- Michael Schuerig mailto:mich...@schuerig.de http://www.schuerig.de/michael/ --~--~-~--~~~---~--~~ You received this message

[Rails] Re: Decoupling the View from the Model

2009-06-16 Thread Michael Schuerig
-controller- presenter.html http://blog.jayfields.com/2007/01/another-rails-presenter-example.html http://blog.jayfields.com/2007/02/rails-presenters-additional-layer.html http://blog.jayfields.com/2007/03/rails-presenter-pattern.html Michael -- Michael Schuerig mailto:mich...@schuerig.de http

[Rails] Re: Decoupling the View from the Model

2009-06-16 Thread Michael Schuerig
. Michael -- Michael Schuerig mailto:mich...@schuerig.de http://www.schuerig.de/michael/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email to rubyonrails

[Rails] Re: Decoupling the View from the Model

2009-06-16 Thread Michael Schuerig
On Wednesday 17 June 2009, Älphä Blüë wrote: Michael Schuerig wrote: On Wednesday 17 June 2009, Fernando Perez wrote: instead of 100 different places. That would be a job for either helper methods or partials. From my understanding, helpers were designed for markup with views. Well

[Rails] Re: 5 minutes to save 25,000 model objects?

2009-06-12 Thread Michael Schuerig
just wastes performance. add_index :keywords, :keyword, :unique = true Michael -- Michael Schuerig mailto:mich...@schuerig.de http://www.schuerig.de/michael/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Ruby

[Rails] Specific exceptions for database errors: please speak up

2009-06-01 Thread Michael Schuerig
-for-violated-database-constraints Please state your opinion and/or support, for otherwise the issue might be delayed interminably. Thanks, Michael -- Michael Schuerig mailto:mich...@schuerig.de http://www.schuerig.de/michael/ --~--~-~--~~~---~--~~ You received

[Rails] Re: under MVC, business rules belong in the __________

2009-05-28 Thread Michael Schuerig
in the controller. That was the point of the controller; it gave a central place to put business logic. That sounds more like Jacobson's Entity-Boundary-Control. Is there a chance you're thinking of that? Michael -- Michael Schuerig mailto:mich...@schuerig.de http://www.schuerig.de/michael

[Rails] Re: writing a custom DB adapter

2009-05-27 Thread Michael Schuerig
to do. If you want to write your own adapter that's at least as deep as you'll have to dive into the code that's already there. Michael -- Michael Schuerig mailto:mich...@schuerig.de http://www.schuerig.de/michael/ --~--~-~--~~~---~--~~ You received this message

[Rails] Re: Product Search Engine Design with Sphinx and Faceted Search

2009-05-25 Thread Michael Schuerig
to find what you need if you start studying it closely starting from its ActiveRecord integration. I don't think you will be able to achieve your goal without understanding details of how Thinking Sphinx works, as you're trying to stretch it beyond its intended use. Michael -- Michael Schuerig

[Rails] Re: Targetting individual rails server processes?

2009-05-20 Thread Michael Schuerig
, with Mongrel and similarly load-balanced servers this works. But how about Passenger? Michael -- Michael Schuerig mailto:mich...@schuerig.de http://www.schuerig.de/michael/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

[Rails] Targetting individual rails server processes?

2009-05-20 Thread Michael Schuerig
.) + load balancer setup, each server process has its own port and presumably the relevant information is accessible from the deployment specification. I have no idea how things are with passenger. Michael -- Michael Schuerig mailto:mich...@schuerig.de http://www.schuerig.de/michael

[Rails] Re: proper way to ensure atomic model changes

2009-05-19 Thread Michael Schuerig
. Michael -- Michael Schuerig mailto:mich...@schuerig.de http://www.schuerig.de/michael/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email to rubyonrails-talk

[Rails] Re: proper way to ensure atomic model changes

2009-05-19 Thread Michael Schuerig
On Tuesday 19 May 2009, Frederick Cheung wrote: On May 19, 11:24 am, Michael Schuerig mich...@schuerig.de wrote: Rails gives you optimistic locking automatically for tables that have the requisite timestamp columns (updated_at). Pessimistic locking you have to do explicitly. As a guess

[Rails] Re: Overwhelmed with choices concerning Rails best practices

2009-05-17 Thread Michael Schuerig
Data Modeling Essentials Morgan Kaufman 2004 Michael -- Michael Schuerig mailto:mich...@schuerig.de http://www.schuerig.de/michael/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post

[Rails] Re: mysql to postgres rake task

2009-05-16 Thread Michael Schuerig
://pgfoundry.org/projects/mysql2pgsql/ -- Michael Schuerig mailto:mich...@schuerig.de http://www.schuerig.de/michael/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send

[Rails] Re: has_many :though and nested attributes

2009-05-16 Thread Michael Schuerig
of trying to build a graph of objects and save them with a single object.save. Michael -- Michael Schuerig mailto:mich...@schuerig.de http://www.schuerig.de/michael/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Ruby

[Rails] Re: has_many :though and nested attributes

2009-05-15 Thread Michael Schuerig
of ingredient_nutrients. I think in order to get better help you ought to post more of your code and the exact exception messages you get. Michael -- Michael Schuerig mailto:mich...@schuerig.de http://www.schuerig.de/michael/ --~--~-~--~~~---~--~~ You received

[Rails] Re: has_many :though and nested attributes

2009-05-15 Thread Michael Schuerig
On Friday 15 May 2009, Branko Vukelic wrote: On May 15, 9:20 pm, Michael Schuerig mich...@schuerig.de wrote: doesn't help, because you're not *creating* ingredients with associated ingredient_nutrients. Rather, you're associating existing ingredients and nutrients with the help

[Rails] Re: Where to put additional code for model.

2009-05-12 Thread Michael Schuerig
will be found automatically. Michael -- Michael Schuerig mailto:mich...@schuerig.de http://www.schuerig.de/michael/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email

[Rails] Re: Where to put additional code for model.

2009-05-12 Thread Michael Schuerig
. Therefore I put this method together myself and would be very grateful if anyone could point out if there are any massive security exploits that I have overlooked. Passing arbitrary, user-provided strings to eval or class_eval *is* a huge security hole. Michael -- Michael Schuerig mailto:mich

[Rails] Re: has_many :through and scopes: how to mutate the set of associated objects?

2009-05-12 Thread Michael Schuerig
concatenates strings. There's no support for expressing, on the one hand, that a specific join is needed (without duplicating it), and on the other, that you want another, independent join. Michael On May 11, 7:34 pm, Michael Schuerig mich...@schuerig.de wrote: I have a model layer containing Movie

[Rails] Re: Multi level asociations

2009-05-11 Thread Michael Schuerig
hook up a model. If you go that way, have a look at http://github.com/aeden/rails_sql_views http://github.com/mschuerig/rails_sql_views Michael -- Michael Schuerig mailto:mich...@schuerig.de http://www.schuerig.de/michael/ --~--~-~--~~~---~--~~ You received

[Rails] has_many :through and scopes: how to mutate the set of associated objects?

2009-05-11 Thread Michael Schuerig
]) I'm not sure this is possible with ActiveRecord as it is, but I'm looking forward to suggestions. Michael -- Michael Schuerig mailto:mich...@schuerig.de http://www.schuerig.de/michael/ --~--~-~--~~~---~--~~ You received this message because you are subscribed

[Rails] Re: updating the db 6000 times will take few minutes ?

2009-05-10 Thread Michael Schuerig
. Michael -- Michael Schuerig mailto:mich...@schuerig.de http://www.schuerig.de/michael/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email to rubyonrails-talk

[Rails] Re: updating the db 6000 times will take few minutes ?

2009-05-10 Thread Michael Schuerig
. Did you have a look at existing text mining tools/frameworks in Ruby as well as other languages? Michael -- Michael Schuerig mailto:mich...@schuerig.de http://www.schuerig.de/michael/ --~--~-~--~~~---~--~~ You received this message because you are subscribed

[Rails] Re: updating the db 6000 times will take few minutes ?

2009-05-09 Thread Michael Schuerig
[2] http://www.postgresql.org/docs/current/static/plpgsql-control- structures.html#PLPGSQL-ERROR-TRAPPING -- Michael Schuerig mailto:mich...@schuerig.de http://www.schuerig.de/michael/ --~--~-~--~~~---~--~~ You received this message because you are subscribed

[Rails] Re: Hardcode database record reference into model

2009-05-06 Thread Michael Schuerig
:inventory_account_type named_scope :of_type, lambda { |type| :joins = :inventory_account_type, :conditions = { :inventory_account_types = { :name = type } } } end And use it as InventoryAccount.of_type(:income).find(...) Michael -- Michael Schuerig mailto:mich...@schuerig.de http

[Rails] Re: How to use json in view file

2009-05-05 Thread Michael Schuerig
-- Michael Schuerig mailto:mich...@schuerig.de http://www.schuerig.de/michael/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email to rubyonrails-talk

  1   2   >