[Rails] Converting TrueClass / FalseClass to integer.

2010-03-26 Thread nick ger
Hello. I'm trying to figure out if there is an easy way to do the following short of adding to_i method to TrueClass/FalseClass. Here is a dilemma: I have a boolean field in my rails app - that is obviously stored as Tinyint in mysql. However - I need to generate xml based of the data in mysql

[Rails] Re: Combining rails intrAnet and public site.

2009-10-15 Thread nick ger
Gaspard, thank you for a reply. I checked out zena before, and while it is a good CMS in it's own right I don't think I can use it as it would require me to rewrite a huge a existing application, or write api hooks. I was mostly looking for a RAILS WAY strategy to implement this. It looks

[Rails] Re: Combining rails intrAnet and public site.

2009-10-15 Thread nick ger
Gaspard, while we are on the subject i was recently considering different systems, and while right now I'm using restful_authentication I looked at authlogic as well. Any particular reason you prefer it over other rails authorization systems? -- Posted via http://www.ruby-forum.com/.

[Rails] Combining rails intrAnet and public site.

2009-10-14 Thread nick ger
Hello, everyone! I was wondering if somebody has some insight on this issue. [h]A little background:[/h] I work for a midsize electronic manufacturing company with 2 people in IT dept - a network admin and a developer (me). We've been using rails to migrate from an old dBase and VB based

[Rails] custom associations

2009-08-20 Thread nick ger
Hi, I was wondering if somebody has any pointer for me. Here is what I have and trying to do. Let's say I have 2 models WorkOrder ( id, ref_number, desc) ( and a bunch of other fields) OldRma ( id, ref_number, customer_data) Work order is a big table that has all the info about the work

[Rails] Re: custom associations

2009-08-20 Thread nick ger
Also to clarify why I need this. I could run a second statement in controller where I find the OldRma, but it's slower then running an include, and OldRma - has other associations that need to be used, so an include would give me an option to have everything in one variable - which makes it

[Rails] Re: custom associations

2009-08-20 Thread nick ger
Frederick Cheung wrote: On Aug 21, 12:16�am, nick ger rails-mailing-l...@andreas-s.net wrote: This obviously breaks cause there is no direct association between two models. �belongs_to with a foreign_key - won't work cause I can't change the primary keys on models. Rails doesn't support

[Rails] Re: custom associations

2009-08-20 Thread nick ger
Fred, Perhaps a diagram would explain it better: http://www.gorbikoff.com/stuff/rails.png the relationship I'm trying to recreate is in red. You can see that I can't change the primary keys as they are already used in other models. So I need to create a custom association here. Nick --

[Rails] Re: custom associations

2009-08-20 Thread nick ger
Also the reason your previous suggestion wouldn't work, cause when you specify foreign_key, rails assumes, that it's a primary key in the table you are referencing. Which it is not. ref_number field is just a varchar field , that while unique is not a primary key in the OldRma model, and

[Rails] Re: custom associations

2009-08-20 Thread nick ger
Also I don't want to add oldrma_id and work_order_id to tables - cause then I have an extra variable to keep track off. And has_many_and_belong_to wouldn't work, cause again I ref_number is not a primary key on either table and it's their for history reasons. -- Posted via