search for: _tony

Displaying 20 results from an estimated 24 matches for "_tony".

Did you mean: tony
2006 Feb 28
8
HABTM count table
Hello, I have a question about HABTM and counting records. I have these models class Sort < ActiveRecord::Base has_and_belongs_to_many :reports end class Report < ActiveRecord::Base has_and_belongs_to_many :region has_and_belongs_to_many :subjects has_and_belongs_to_many :sorts end And i would like to get a count like @sort.reports.count The problem is get this query:
2006 Mar 05
8
Model Inheritance, Mixins and Database design
...herit the View for Company for ServiceType b/ by invoking Ruby''s super keyword somehow. 3/ Would it be better to have individual db table representing each ServiceType will the extra properiies that each ServiceType has in addition to the inherited Company properities require this _tony -- Posted via http://www.ruby-forum.com/.
2006 Feb 26
5
Subversion | CVS | Sourceforge | OS X : Tutorials
...new to RoR and creating a Sourceforge project was recommended as a way of working and learning from/with others. But I can''t get over the hurdle of transferring what I''ve already build to csv.sourceforge or subversion.sourceforge. All my attempts generate command line errors. _tony -- Posted via http://www.ruby-forum.com/.
2006 Mar 06
4
Are views inheritable
Is it possible to use a child model''s controller to impliment it''s parents view before adding its own output ? possibly by the use of super ? _tony -- Posted via http://www.ruby-forum.com/.
2006 Feb 28
4
multiple keys table
probablly a newbie question: Rails does not support a table with multiple keys ??? it seems that the ActiveRecord set_primary_key method can only set the column name... (hope i''m wrong there) example: table A - P.K id, string name table B - P.K id, string name table C - P.K a_id and b_id, both are also foreign keys. Thanks, Amir. -- Posted via http://www.ruby-forum.com/.
2006 Mar 05
9
Rails Development on a Mac Mini?
How many people out there are doing Rails development on a Mac Mini? I''ve been eyeing up the MacBook as well as the new MacMini trying to decide if I want to splurge. I''ve been doing very little Rails development thus far which makes the investment a little hard to justify. The Free Mini Mac ( http://minimacs.freepay.com/?r=16778073) offer seems like the best route but
2006 Feb 27
1
Models and Inheritance
...d, and why a class method should - I''ve read it''s used when you want it to apply the same to all object instances ie count_the_number of companies Can anyone explain what I''ve obviously misunderstook, is my appraoch using inheritance in this manner inappropriate ? _tony -- Posted via http://www.ruby-forum.com/.
2006 Mar 09
15
open source editor
does anyone know of a good place to find an open source / freeware text editor? -- Posted via http://www.ruby-forum.com/.
2006 Feb 22
5
Optional Include Relationship
I did some searches in the mailing list and on the web but I can''t seem to find the answer to this, but it''s pretty much a noob question. I have a Product object class Product < ActiveRecord::Base has_many :product_identifications has_one :product_identification_item_number has_one :product_identification_product_code end the product_identifications is using
2006 Feb 24
9
Growing beyond unsigned integer for the id field
I am creating an app that will out grow an int(10) unsigned for the id field, ie. 4,294,967,295 records. What are my options, I have looked at the GUID plugin that lets you use a 32 char GUID, but I still want the id''s to be sequential, and (I think) that the overhead of searching a varchar field will be too big for such a large number of records. It does not appear you can use a
2006 Mar 01
1
How-to question: form creation / different table update
I could use some direction. I need a form to collect information on a user''s allergies. I want to present them with a form much like the one we fill out when we see a new doc where you just check-off the things you''re allergic to. When the form comes back to the controller I want to add a record to a table for each allergy they''ve checked. I was thinking I should
2006 Mar 08
1
Nil Object Error
I''m a complete newbie when it comes to Ruby on Rails. I have lots of experience in PHP, but yesterday was the first time I sat down and began developing using Ruby on Rails (I''m impressed!). Anyway, I''m having a problem with edit/update of records when using form validation. Here are my files for reference. ticket.rb ============ class Ticket <
2006 Mar 11
3
Helper methods for ActiveRecord
Hi all, I have several models which all have an email field. This email address should of course be validated and for that I have this nice regex. But now I have the email validation method copied throughout my different models. Which is clearly stupid. I figured I needed a helper (module?) and use this helper I my models. But I can''t seem to find anyway of helpers for models, only
2006 Mar 13
2
newbie: parent-child view
I have a simple database: a list of manufacturers (parent) and the parts (child) for the manufacturer. >From scaffold, I have a ?show? view listing manufacturers. I modified this view to list the parts for the manufacturer. I also have a link to create a new part. This causes the controller to display a new view to create a new part for the manufacturer. So creating the part is AOK,
2006 Mar 13
2
Rails : Objects, Patterns and Practice
I''m currently learning Rails and reading PHP5 Objects, Patterns, and Practice. Its a great intoduction to Singletons, Factories etc but can anyone recommend a similar resource for Rails or failing that Ruby. ? thanks Tony -- Posted via http://www.ruby-forum.com/.
2006 Feb 26
1
HABTM SQL generated
...service so I''m using @companies = Service.find_by_name(''servicename'').companies. But in the development log, rails appears to be making 2 sql calls - one to find the id of the service and a 2nd to find the companies by that id. How can i reduce it to one sql call ? _Tony -- Posted via http://www.ruby-forum.com/.
2006 Mar 06
4
Newbie problem with adding new method to a class
Hi! If i have Image class and i''d like to add ''create_thumbnail'' method to it, which will later be called from product controller, where to put this method and how to call it? I''ve tried putting it inside image controller and image model, then call it like Image.create_thumbnail, but it didn''t work - undefined method `create_thumbnail''
2006 Mar 12
5
AR - Migrations - how to use a varchar as primary key instead of int ?
Hi I''d like to have a varchar primary key named id instead of the default int id. Does anyone knows how to specify this from migrations ? Should I also specify something in the model class ? thanks! Thibaut -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060312/797bca4b/attachment.html
2006 Feb 26
3
Rails Naming Conventions
DB field names: If I have a table that references 2 or more separate users from my users table, is there a recommended naming convention for this situation? In my case, I have 3 users associated with a record in my projects table: requester_user_id created_by updated_by I could name one of them "user_id", and then projects.user would work I guess, but wouldn''t work
2006 Mar 01
6
How to retrieve attributes from HABTM?
We have tables Users and Communities linked by has_an_belongs_to_many. The join table Communities_Users has additional fields [ is_active, is_blocked, join_date] etc. These are populated using @user.push_with_attributes(:is_active => true,...). Later on how do we update or retrieve the attributes in the link table for a given user or a community with doing it explicitly using SQL? Thanks,