search for: popdog

Displaying 20 results from an estimated 23 matches for "popdog".

2006 Jul 06
5
Single table inheritance
I''m having a class called Person, with subclasses as goalkeeper, forward, defender. Now a person can be a forward as well as a defender or a goalkeeper. I want to use single table inheritance like : class Goalkeepr < Person end And not have multiple boolean columns like in my people table like is is_goalkpeer, is_forward, is_defender. How do I go about it ? Thanks, Pratik -- rm
2006 Apr 22
4
Slice and dice plugin
...ms.dup.reject! {|k, v| [:action, :control ler].include? k} @animals = Animal.find :all, :conditions => animal_conditions end end This allows urls such as /animal/list?name_starts_with=T&population_less_than=1000 Please take a look, the code is available at svn://rubyforge.org/var/svn/popdog/slice_and_dice/tags/REL-0.1 I''d welcome any comments or ideas on how to improve this (currently very simple) plugin. I do have some planned extra features of my own, so watch this space! Tom -- email : tom at popdog.net
2006 Jul 07
5
Can a route require POST or GET? / REST problem with routing
Hi, A store front a customer wants to GET /product/5/show. But for the application this is really GET /cart_item/new/5 or even better /cart_item/new?cart_item[product_id]=5 When the customer clicks add_to_cart they POST /product/5/show so that the url doesn''t confuse the user when any validation errors occur. But for the applicaiton this should be POST
2007 Mar 03
2
Could patch #7703 (SQL Server bug fixes) be applied?
I''ve packaged three small SQL Server bugfixes into patch #7703, and tested against SQL Server 2000 and 2005. Would a member of core mind applying this patch? Once this is done, I''ll start looking at some of the other SQL Server tickets. Tom --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups
2006 Jan 23
4
Using :id=>''something'' vs :mid=>''something'' params
Is there any reason for using :id=>''something'' instead of :mid=>''something'' in link_to or link_to_remote? (well other than generating a nicer link) My tool for analysing apache logs is considering /controller/action/4 as a different link than /controller/action/5, so instead of counting /controller/action it will count every variation of that parameter.
2006 Jan 23
4
Proposal: Deprecate ADO support in the SQL Server adapter
The SQL Server adapter can currently operate in two modes, ADO and ODBC, each of which uses a different interface to access the db. The ADO interface is currently the default, while ODBC can be specified as an option. I propose this situation is reversed, and that use of the ADO interface is deprecated, if not removed altogether. Here are some reasons, I'm sure there are more: a) ADO uses
2006 Jul 05
10
Scalable alternative to #find_all
Is there any scalable alternative to iterating all the records of a certain model? #find_all seems to load everything into memory. With 500.000 records it will be a swap storm. Pedro.
2006 Jul 05
19
associations question
Hello, I have a People table and a Addresses table. A person can have one or more addresses, but should at least have one, so there is a address_id field in People. Now, I would like to have a form to fill the name of a new person and its address from the same place. I could use person.address.country, for example (it works), but I would like to simply use person.country for some reasons
2006 May 18
2
Rake: How to determine the Rails version?
Hi all I''m learning to use Rake for migration etc. I wonder if there''s a way to determine the currently used Rails version, so e.g. when installing a new engine using Rake I could check if there''s a version used that''s older as needed and so abort the installation. You know what I mean? ;-) Thanks and greetings, Joshua -- Posted via
2006 Jan 18
0
subclasses_of - why does it ignore subclasses within modules?
...:D is also a subclass of A class E < C::D end Object.subclasses_of(A) # returns [B, E], even though C::D isn''t returned This behaviour has been very deliberately built into the code, but seems to be plainly wrong. Can anyone provide any insight why this is so? Tom -- email : tom at popdog.net
2006 Jan 19
3
Why does Object.subclasses_of ignore subclasses within modules?
ActiveSupport provides a method Object.subclasses_of, shown below: def subclasses_of(*superclasses) subclasses = [] ObjectSpace.each_object(Class) do |k| next if (k.ancestors & superclasses).empty? || superclasses.include?(k) || k.to_s.include?("::") || subclasses.include?(k) subclasses << k end subclasses end Can anyone shine some light on why
2006 Jul 05
2
Association Extensions
Hi, I''m using an assocation extension as follows: module RequestFinder def open find(:all, :conditions => "buyer_requests.closing_date > \''#{Date.today}\''") end def closed find(:all, :conditions => "buyer_requests.closing_date <= \''#{Date.today}\''") end end with the following ActiveRecord class User
2006 May 03
3
Sorting by multiple categories
I have a database with a field called ''category''. ''category'' contains the categories separated by a "," i.e. 1, 2, 5 I know with something like: @products = Product.find(:all, :condition => "category = ''1''") I could get some results if any of the ''category'' fields only contained "1" but
2006 Jan 16
2
My first test - named fixture not autoloading instance variable
I''m trying to write a test like the one at the bottom of page 148 in Agile Rails. I''m using rails 1.0 I''ve created the fixture correctly I''m pretty sure because the test database table is being populated per the fixture. I have what I think is a simple unit test: ========= require File.dirname(__FILE__) + ''/../test_helper'' class CaseTest
2006 May 22
2
How to execute time consuming code
Hello all, I have a screen scraping application (go to a lots of sites, extract 10k stuff, integrate the results, put them to DB etc). Now i want to use a Rails application as a frontend to this: The user can push a button which triggers the screen scraping app and view the results (preferably asynchronously, but that does not really matter right now). Questions: - Should the screen scraping app
2007 Jan 18
4
Defining the expected behavior of DatabaseStatements.execute()
It would be very helpful if the core team could define and document the expected behavior of DatabaseStatements.execute(). The implementations appear to vary. Most adapters will return some sort of native result set, SQL Server returns nil and expects a block, DB2 and Sybase return the affected row count. So please, will someone in core explain the expected behavior and can the execute()
2006 Jan 17
4
find_by_sql column ordering defect?
Hello. I have a program that accesses a metadata (translation) table for column names as well as the ordering of columns for a specific model. Also in there is a collection of bool options such as column_visible_on_form, column_visible_on_screen_quicklist etc. The idea is that our customer can specify to a certain extent how their layout/user interface will appear. To accomplish this, I use
2006 Jan 19
9
start_form_tag not taking url_for options
I''ve got a form that should post to user/login. The code to start the tag is: <%= start_form_tag { :controller => "user", :action => "login" } %> That gives me this exception: compile error script/../config/../app/views/user/login.rhtml:1: parse error, unexpected tASSOC, expecting ''}'' _erbout = ''''; _erbout.concat((
2006 Jan 20
47
SQL Server datetime error
i have a problem with the datetime format of rails. i am unable to save a dataset to the db. here''s the error message -- the original error message was in german, so i translated it -- i get: DBI::DatabaseError: Execute OLE error code:80040E07 in Microsoft OLE DB Provider for SQL Server Couldn''t convert a char-Datatype to datetime HRESULT error code:0x80020009
2006 Jan 09
11
Scaleability and Sharing of code between apps
Application 1 is an auditing application called AuditSystem. Application 2 is a quality control appllication called QC. App1 has a couple of classes, including models, that i would like to use with App2. I would like a change in a class to be felt in both applications. How do i acheive this without copying and pasting code?? At the moment im feeling i should have made the whole thing one