search for: papipo

Displaying 18 results from an estimated 18 matches for "papipo".

Did you mean: papier
2006 Dec 21
5
Advice with Model tests
Hi! I''m developing a rails applicaton with specify-before approach, with nice results so far. I use mocks and stubs in both Controller and views tests, but the main issue is with model testing. Since I''ve seen many examples here and there, I don''t know if the right way is to use fixtures or not at all (in model specs). Atm, I''m using them, but I
2007 Aug 27
2
Testing arbitrary SQL
Hi, I would like to know how would you test a method in a model that uses complex a SQL query that joins several tables in order to make a calculation. I suppose that I need fixtures, although my approach with rspec is to avoid fixtures and isolate model specs, but none of both seems possible in this case. Is there another way than fixtures? Thanks.
2006 Oct 22
1
Rails association and multiple indexes
Hi! If I have two models, Product and Manufacturer, of course Product belongs_to :manufacturer. A search engine would allow a user to look for a product by its name or manufacturer. Is it better to define a method like: def searchable_field "#{name} #{manufacturer.name}" end and add it as indexable field (acts_as_ferret :fields =>
2005 Dec 22
4
advice on MySQL version
I am going to start a project from scratch with MySQL. Is it a good idea to go ahead with MySQL 5? Is there any gotcha with that version as of today? -- fxn "We all agree on the necessity of compromise. We just can''t agree on when it''s necessary to compromise." -- Larry Wall in comp.lang.perl
2007 Aug 24
26
testing behaviour or testing code?
hypothetical question for all you BDD experts: I want to make sure that a :list action always returns widgets in alphabetical order. There''s at least 2 ways of doing this: it "should fetch items in alphabetical order" do Widget.should_receive(:find).with(:order => "name ASC") get :list end it "should fetch items in alphabetical order" do [:red,
2007 Aug 31
48
Deprecating the mocking framework?
I saw in one of Dave C.''s comments to a ticket that "our current plan is to deprecate the mocking framework." I hadn''t heard anything about that, but then again I haven''t paid super close attention to the list. Are we planning on dumping the mock framework in favor of using Mocha (or any other framework one might want to plug in?). Pat
2006 Nov 04
0
unique boolean flag
Hi! I have a field "default", and i wish to validate that only one of the records is true, the remaining must be false. If there are no records, the first one created must be default=true. Apart from that, when any new/updated record is set to default=true, the remaining ones must be default=false. How do you accomplish this? Thanks in advance, Rodrigo. -------------- next part
2006 Mar 14
0
Multiword autocompletion
Hi, I would like to write a search engine for a site, with real-time spell checking. So i need to pass the word beign written atm, not the full field value. If the user clicks one of the suggested words, only the last word should be replaced, not the entire content. Is there any way of doing this? Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL:
2006 Feb 21
0
Module and model names
Hi! I have a Admin < User model (STI), and I want to create an Admin module to group some controllers. So i have a model and a module with the same name. If i query the database for an Admin User in one of those controllers, rails tells me that there is a TypeError. I can''t specify model :admin in the controller, since it doesn''t works. I can fix this by require
2006 Jan 04
2
simple_format and in_place_editor_field
Hi! How can i do to force an in_place_editor_field to format the text with simple_format while not editing? Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060104/bbd141a2/attachment.html
2005 Dec 14
0
eager loading all associations
Hi Railers, Is there a way to specify all relations in a :include option while find()ing? I have a model with a lot of associations, and sometimes i would like to query for all them. Something like Model.find(params[:id], :include => :all) would be nice. Alternatively, i don''t know if there is a mehod to retrieve all model''s associations, to do something like
2007 Jan 25
0
Testing RJS select method
Hi How can I test this kind of RJS code? page.select ''#id .class''.each do |element| element.removeClassName(''whatever'') end I know that should_have_rjs admits a block, but i don''t know exactly which is its purpose. And I can test that the "select" part is beign called, but I don''t know hot to test the "removeClassName"
2005 Dec 16
2
Shared code for controllers
Hi, I think that this is made from a plugin or something in /lib/, but i really don''t know which is the better way: I have this in my MediasController: def mediatype_medias_options if params[:id] begin @mediatype = MediaType.find(params[:id]) render :inline => "<%= options_from_collection_for_select @ mediatype.medias, ''id'',
2006 Feb 23
2
create_for_*
Hi! If I have a /budget/create action, how should I make a /budget/create_for_customer without repeating myself? I could create a "create_for_customer" action and call "create" from there, but stripping the customer select_tag somehow, since customer_id will be passed from /customer/show. How do you do the create_for_something stuff? Thanks, Rodrigo. -- Posted via
2005 Dec 26
2
Fedora Core 2, cPanel and Ruby
Hi, i have a live server with Fedora Core 2 and cpanel. I want to install Ruby 1.8.2, so i can use rails, but it has some dependencies that need to swith the computer to Fedora 3. It requires a new version of openssl, which breaks dependencies in a LOT of packages. What do you recommend me to do? Update the whole system (how?), use some kind of chroot to install the new version of ruby...?
2006 Aug 16
4
Plugins and svn
Hi railers, What do you do when you must use a plugin in a rails app that is under subversion? I think that an approach is simply install a version of the plugin, and once all the test pass, commit the plugin itself to the repository, inside the /vendor/ of the app. If a new version of the plugin is released, your app is still using the working one (although the new version could work too).
2005 Oct 19
4
ER strikes back
Hi Railers, A long, long, time ago, i made a Framework/CMS in php. There were two core models: Content and Content_type. Content_type was only a list of content types (as expected): new, article, etc. Content_type was not mandatory, but it allowed later to "deactivate" types of contents, for example. So then Content stored the common attributes/properties between the different content
2006 Feb 17
16
Booking system
Hi! I''m planning a booking system in rails, and I have the following issue: There will be room_types. I can implement this with STI in the rooms table, or with a separate table room_types. Each room type will have its special features. For example, a double room can be: -- Posted via http://www.ruby-forum.com/.