[Rails] Re: CardDav

2011-06-11 Thread Andrew Pace
If no one knows how with CardDav, anyone have experience with WebDav? Andrew On Jun 7, 8:09 am, Andrew Pace andrewpp...@gmail.com wrote: Anyone have experience re-writing the rails router to add support for a carddav service? If you know of any resources, please send them my way. Thanks

[Rails] Re: Problem with join table

2011-06-11 Thread Andrew Pace
Anyone? -- 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@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options,

[Rails] CardDav

2011-06-07 Thread Andrew Pace
Anyone have experience re-writing the rails router to add support for a carddav service? If you know of any resources, please send them my way. Thanks! -- 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

[Rails] Problem with join table

2011-06-06 Thread Andrew Pace
Hi all, I am trying to model with AR some tricky db tables. The table names are in caps and any constraints below or next to the column. The tables: USERS id PK username etc PROFILES id PK user_id FK references users(id) name unique (id, user_id) TELEPHONES id PK user_id FK references

[Rails] Re: updating user status

2010-01-12 Thread Andrew Pace
I recommend keeping the table. Let me explain why and try to explain how to set it up better. This type of information is known at the outset of the application and it sounds like it is unlikely to change significantly over time. As such it could be pulled into a domain table, similar to states

[Rails] Re: When/why/should I unit test validations?

2009-12-24 Thread Andrew Pace
You are right that everyone seems to disagree on this point. I think validating the data is one of the most critical parts of an application. I tend to validate at the db level and model level to ensure integrity (as the app is not necessarily the only point of entry to the db--psql prompt,

[Rails] Re: Why not associations without an extra table?

2009-12-15 Thread Andrew Pace
Give us more code, because this can be done in a single step. Chaining method calls like that will return a single department object (e.department). So it should be no different, and I have done similar things in the past without trouble. The only time this shouldn't work is if you try

[Rails] Re: Approaches to improve response times for web pages who's HTML content is loaded through Rails???

2009-12-15 Thread Andrew Pace
I believe that paperclip actually stores a copy of the images in the public directory by default. Once the html is rendered to the browser the image requests should not go through the rails stack. Let us know what firebug says. Browser load times are dependent on many factors, and often the

[Rails] Re: Why not associations without an extra table?

2009-12-14 Thread Andrew Pace
Looks to me that you don't have the right model relationships defined. in order to do e.department.customers, the Department class has to know about the relationship with Customers. You should have: class Department AR::Base has_many :customers end I think this should work, if everything

[Rails] Re: From DB to migrations

2009-12-14 Thread Andrew Pace
I assume you know this because you asked just for the structure, but the rake commands that Rick points you at will get you what you asked for, but not things like FK constraints, other constraints, transactions, etc. It will give you the schema though. Andrew -- You received this message

[Rails] Re: Too many methods in the model? Extra lightweight logic layer?

2009-12-14 Thread Andrew Pace
Agreed with Jeff. The AR models really act as a wrapper class to DB tables. This helps to add an abstraction layer to SQL and marshall SQL selects into powerful ruby objects (the best part, in my opinion). With that in mind create non-AR models as needed, and only use the AR models when the

[Rails] Re: Multiple choices inside the model

2009-12-14 Thread Andrew Pace
I don't know Django, but it looks to me like you are trying to setup a hash. location_choices can be a local variable, instance variable, constant, etc depending on your needs. @location_choices = { AMS = Amsterdam, RTM = Rotterdam } If you want it to be a constant, just capitalize it. Local

[Rails] Re: redirect without changing url

2009-12-11 Thread Andrew Pace
You really need to give us more information to help. If you want just the layout from the other action, you can use render. However, render will not execute the code from the controller's action method; it will only render the template. If you want to execute the code and truly redirect, I

[Rails] Re: ROR Newb question - multiple models, one form / populating drop-downs from tables

2009-12-10 Thread Andrew Pace
I agree with Colin above. Make a model level method to return the data you wish to use in the view. Then within the view call ValidValues.method_you_make. Like he said, another option is to put this code in the controller, but most of the time, the dropdown select menus have little to do with

[Rails] Re: ROR Newb question - multiple models, one form / populating drop-downs from tables

2009-12-09 Thread Andrew Pace
There are many approaches to this problem. Some involve setting up the code in the controller, others use a presenter. Google presenter pattern for more info on that. The build method might be what you are looking for. This is created as you define your model relationships. If you use it, it

[Rails] Re: how to login in spree

2009-11-14 Thread Andrew Pace
In development mode, it should not redirect to https://... The default settings only enable that for production mode. I would try to change that setting back to default so that it goes to http://localhost/login. This could be the problem if the rest of the site works. Andrew On Nov 14, 2:55 

[Rails] Re: ** UPDATE** Adding SEARCH functionality to a website

2009-10-27 Thread Andrew Pace
I assume that you have tried this but if not it is worth a shot. If your model was filled with data prior to setting up ferret, then I don't believe those rows will be indexed. You will need to build the index or rebuild it. If you have not added any new data to the database, you may very well

[Rails] Re: multiple rails app with passenger on Debian

2009-10-27 Thread Andrew Pace
Configuring virtual hosts can get tricky the first few times you do it. Slicehost has excellent articles on the subject. http://articles.slicehost.com. I go there often. Just look for the articles under your distro. Andrew --~--~-~--~~~---~--~~ You received

[Rails] Re: Multiple user types with Authlogic

2009-10-25 Thread Andrew Pace
I agree with Marnen. The easiest way would be to just add a role field to the user model. I wouldn't mess with inherited classes or associations for what you are describing. But if you do, you really should use inheritance, as Marnen described. The only other table that I might consider would

[Rails] Using transaction in non-active record model

2009-10-12 Thread Andrew Pace
I want to use logical models to aggregate data to present information to the user. For example, I have a controller: class OrdersController ApplicationController def end --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

[Rails] Re: Using transaction in non-active record model

2009-10-12 Thread Andrew Pace
Sorry about above. The post should be: I want to use logical models to aggregate data to present information to the user. For example, I might have a controller that looks like the following: class OrdersController ApplicationController def new @order = Order.new @address =

[Rails] Re: Scaling database. The easiest one!?

2009-10-07 Thread Andrew Pace
I too choose PostgreSQL by default. Here are some of my reasons. 1) It adheres more reliably to SQL standard than MySQL. 2) PostgreSQL has a better query planner than MySQL. 3) The number value zero in MySQL is treated NULL. 4) The default settings for MySQL make it case IN-sensitive. 5) Until

[Rails] Testing Referential Integrity

2009-09-27 Thread Andrew Pace
Hey all, I am having a little trouble getting some referential integrity tests to work well. Right now, I am using Postgres as my database. I have generated migrations for my tables and ensured referential integrity by using execute commands. All is working well at the level of the database

[Rails] Re: ActivRecord APIs for DB transactions

2009-08-24 Thread Andrew Pace
Another good link: http://api.rubyonrails.org/classes/ActiveRecord/Transactions/ClassMethods.html Andrew --~--~-~--~~~---~--~~ 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: ActivRecord APIs for DB transactions

2009-08-24 Thread Andrew Pace
It is also good to know that the save and destroy methods already use transactions to ensure before and after callbacks. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this

[Rails] Re: URL-Based Thumbnail Generation

2009-08-21 Thread Andrew Pace
Thanks so much for the feedback. Very helpful. I will be switching my ways... Andrew --~--~-~--~~~---~--~~ 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

[Rails] URL-Based Thumbnail Generation

2009-08-20 Thread Andrew Pace
I am currently have a 'products' table that has a :has_many relationship with a 'photos' table. I am uploading photos to accompany products. Right now, I upload the photo, save the metadata to the 'photos' table and the image to the filesystem. Then, I direct a url from within the products

[Rails] Using Select Helper

2009-08-03 Thread Andrew Pace
, all the examples use numeric values. Any ideas? Thanks, Andrew Pace - % form_for(@product) do |f| % %= f.error_messages % p %= f.label :name %br / %= f.text_field :name % /p p %= f.label :description %br

[Rails] Re: Using Select Helper

2009-08-03 Thread Andrew Pace
Please ignore. It was a problem with my migration file. Thanks --~--~-~--~~~---~--~~ 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@googlegroups.com To

[Rails] Associations Question

2009-08-01 Thread Andrew Pace
I have a three table construct. A Users table. Users have a one-to- one relationship with a Carts table for saving the contents of a shopping cart to the DB. I have a Products table for holding product information. The Carts have a many-to-many relationship with the Products. (One cart might

[Rails] Learning some best DB practices

2009-07-31 Thread Andrew Pace
know if this would be considered a poor way of managing data in the rails way. It seems to me that it would function similarly, in that it would save a lot of updates with the db- migrations. Thank you in advance for your help! Andrew Pace Here are the actual SQL statements for a real site

[Rails] Re: Learning some best DB practices

2009-07-31 Thread Andrew Pace
Thanks for your feedback. It is possible to ensure certain formats for the text column prior to saving it to a database. This makes querying this data quite easy in fact. Just because the user entered in a form like 2/12/1980, doesn't mean it has to get stored in that fashionI would hope

[Rails] Re: Learning some best DB practices

2009-07-31 Thread Andrew Pace
Also consider the demands of a very very rapidly changing field, like medical informatics. In this area, many prefer the flexibility of a key/value system because adding columns constantly would be a nightmare. Think off adding columns for every new lab test, imaging type, procedure, etc. This

[Rails] Re: Learning some best DB practices

2009-07-31 Thread Andrew Pace
Even a wikipedia article on it. http://en.wikipedia.org/wiki/Entity-attribute-value_model Andrew --~--~-~--~~~---~--~~ 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

[Rails] Re: Learning some best DB practices

2009-07-31 Thread Andrew Pace
Thanks On Jul 31, 11:11 am, Marnen Laibow-Koser mar...@marnen.org wrote: On Jul 31, 1:43 pm, Andrew Pace andrewpp...@gmail.com wrote: Also consider the demands of a very very rapidly changing field, like medical informatics.  In this area, many prefer the flexibility of a key/value