search for: monkeypatch

Displaying 20 results from an estimated 43 matches for "monkeypatch".

2008 May 15
1
How to monkeypatch in a plugin
Hi all, I''m working on a plugin that enables automatic profiling and benchmarking for unit tests. I need to monkeypatch Test::Unit::TestSuite to redefine the run method. Based on the example I see at http://svn.jthopple.com/plugins/count_limit_associations, I thought I should be able to simply open the class in question in /lib/profile_tests.rb, e.g. module Test module Unit class Suite def run...
2009 May 18
0
how to monkeypatch Hash's = method, revisted
So google for a solution to this problem and found myself here: http://groups.google.com/group/rubyonrails-talk/browse_thread/thread/eaa34998a74831b4/58b80fe0d4eadb1a?lnk=gst&q=+how+to+monkeypatch+Hash%27s+%5B%5D%3D+method+#58b80fe0d4eadb1a But while reading, and admittedly not quite getting the solution, I had a bright moment to balance out the stupid moment, realising that [] = already has an alias to which you can delegate: class Hash def []= key, value store processKey(key), proc...
2007 Jul 19
3
InPlace[Collection]Editor rewrite: it's in trunk!
...ing-the-summer-2007-rewrite Do note that this is my rewrite, so if you find bugs etc., don''t go yelling at Thomas: I''m the one to blame! We''ve seen a striking increase of posts here about IPE, and I can only hope you''ll find the new version great. A lot of you monkeypatched your IPE to fit your needs, and this monkeypatching may very well need to be ported over to the new release before you can use it confidently. As always: test like crazy! Cheers, -- Christophe Porteneuve a.k.a. TDD "[They] did not know it was impossible, so they did it." --Mark Twai...
2008 May 03
11
Date comparisons
I occasionally get this error: 1) ''A puzzle once featured, should no longer be nominated'' FAILED expected: Sun May 04 09:10:26 -0700 2008, got: Sun May 04 09:10:26 -0700 2008 (using ==) ./spec/models/puzzle_spec.rb:180: So, the dates looks the same to me. Any ideas for how to debug? Joe
2007 Apr 09
10
changes in 0.8 and greater - should_
Has the should_... syntax changed? I''m getting errors when running the following: should_render(:index) should_be_valid should_not_be_valid should_respond_to should_be should_render I thought the syntax changed to something like the following: obj.should render(:index) but this doesn''t seem to work. Scott
2006 Aug 15
2
to_xml and underscores
hi, i am looking for a solution whereupon calling myEntityObject.to_xml does not convert my attributes containing underscores into hyphens. at the moment an attribute named "my_own_attribute" is converted into <my-own-attribute>. does anybody have an idea how to change that and have to_xml generate <my_own_attribute> thanks ciao robertj -- Posted via
2006 Mar 22
1
RJS - Still not working in IE
...re-iterate, this rjs works in Firefox and Safari on Mac, and in Firefox on Windows. It fails, in IE on Windows. The failure is that the second page.replace_html seems to do nothing. My environment is: Rails 1.0 + RJS Plugin Updated Javascripts to Scriptaculous 1.5.3 (for evalScripts support) Monkeypatched in_place_editor to support evalScripts This is the complete contents of the .rjs: page.replace_html ''current_search_name_editor'', :partial =>"search_name" page.replace_html ''search_pane'', :partial => "search" My view contains: ......
2009 Mar 24
12
MonkeyPatching ActiveRecord::Base class
I am trying to monkey-patch the ActiveRecord::Base class to incorporate a generic search class method so that it can be used by all model classes which need this functionality. Since model classes directly inherit from ActiveRecord::Base and unlike controllers and helpers, do not have an ancestor class defined, I think I am forced to open the ActiveRecord::Base class and patch it? May be I am
2010 Sep 08
2
Rails 2.3.9 breaks sessions with Active Record or Memcache store
...t existing cookies will not be able to log in, for example (this is how I discovered the bug). Lighthouse ticket and fix is here.<https://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/5581-session-cookie-not-sent-with-activerecord-or-memcache-store-in-rails-239> An unobtrusive monkeypatch for existing apps can also be found on the ticket. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-...
2007 Apr 11
12
redirection doesn''t get detected well?
I''m doing a redirect in one of my controller actions and somehow I can''t spec it, see this pastie: http://pastie.caboo.se/53120. When following the link from a browser I''m being redirected to the right page. -------------- next part -------------- An HTML attachment was scrubbed... URL:
2006 Mar 18
9
RJS - not working in IE
I searched thru all the postings about RJS, and I didn''t find one person who complained of problems specific to IE, but that''s what I''ve got. My environment is: Rails 1.0 + RJS Plugin Updated Javascripts to Scriptaculous 1.5.3 (for evalScripts support) Monkeypatched in_place_editor to support evalScripts I have just started using RJS, and I have two .rjs templates. They are quite simple, each template has two page.replace_html statements, which look like: page.replace_html "some_id", :partial => "some_partial" page.replace_html...
2008 Jan 20
3
CookieStore and Session data via POST vars (no cookies)
...ssing in the session_id variable through a POST parameter in the upload. I''ve verified that Flash is sending the POST params (Flash 9). I thought simply by setting cookie_only to false for that method, I would be able to get that to work. Turned out I had to do a couple of small monkeypatches to CookieStore to get it to work. The only ticket I found that references this is http://dev.rubyonrails.org/ticket/210 , which is old, old, old but seems to imply that this sort of thing should work. So, my question is whether the fact that the CookieStore doesn''t honor the for...
2010 Apr 14
5
Model Magic
>> [].eql? @product.files => false >> @product.files.eql? [] => true version: 2.3.5 Product :has_many files -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to
2009 Mar 06
5
ActionMailer Layout on HTML version not Plain Text
I''m sending plain text and html emails by having multiple files for each email I send. For example, for my registration email I have a registration.text.plain.erb file and a registration.text.html.erb file. I want to use a layout for the html version of my emails. In my mailer I put: class AccountsMailer < ActionMailer::Base layout ''email'' ... end
2009 Mar 09
3
multiple columns primary key
Hi all, I have two tables: TABLE 1 A pk - fk (referencesc TABLE 2) B pk C pk D pk E F TABLE 2 A pk G H I L I don''t use incremental field (id). I''d like don''t use find_by_sql. How can I define both models to use correctly find method (with include)? With only one column primary key I haven''t problems. I thought two solutions, but I don''t like these
2007 Jul 22
18
db:fixtures:load order
I was trying to deal with foreign key issues related to order of fixture loading when I came across this: http://techpolesen.blogspot.com/2007/04/rails-fixture-tips.html This got me looking deeper into rails and I noticed that db:fixtures:load calls Fixtures.create_fixtures once for each fixture file. However, Fixtures.create_fixtures is capable of taking multiple files and also handle the
2010 Apr 06
3
(Rails3-master) erubis: how to use things like preprocessing?
(Rails3 latest git master) Subject says it. I''m trying to figure out how to use erubis features described here: http://www.kuwata-lab.com/erubis/users-guide.05.html#rails, especially preprocessing. My question is, where do I place the Erubis::Helpers::RailsHelper.preprocessing=true Not in application.rb, at that point the object does not exist yet it seems. I wonder why I
2008 Jan 22
0
Revactor 0.1.0 released
Original announcement available here: http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/288133 Revactor (an Erlang-like Actor framework for Ruby 1.9) includes a monkeypatched Mongrel which uses Actors (implemented as Fibers) as the underlying concurrency primitive, rather than Threads. It seems to be performing fairly well (better than Threaded Mongrel, afaict). I have plans to move the HTTP request parsing and response writing to an asynchronous HTTP server built o...
2008 Mar 25
0
ActionMailer and Sender validation frameworks ( DKIM or SPF )
What''s the directors'' take on ading DKIM or SPF functionality into ActionMailer. Is that a function that is better addressed via a plugin, or would an extension or a monkeypatch of this class be an appropriate avenue of pursuit? Steven --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3Mbo...
2008 Jun 04
2
Overriding default ActiveRecord behaviour
Hello everybody, By default doing like this: person = Person.new person.name = "John" person.save! Will cause a new row to be inserted into database. But I don''t want it to be saved into DB, instead when "save!" method is called I want to connect to a particular URL and post data to it. For instance: POST http://my.app/people/create "name" =>