[Rails] Validations / callbacks & remote API

2012-03-05 Thread Michael Rigart
Hi, I'm trying to find a descent solution for the following problem: Lets say I have a model called List. When you create a list, a name is required (validation is in place). But when a user creates a list in the application, a simular object needs to be created on a remote system through the use

[Rails] Re: rails 3.1 assets:precompile deployment

2011-09-10 Thread Michael Rigart
@aldo, thanks for the info. I'll look into it. But it seems that I don't find any problems atm. Meanwhile, I've been playing a bit around to see what happens during the precompilation task. (I used the task from rails head for testing, not the buggy one included in rails 3.1). I have noticed t

[Rails] Re: rails 3.1 assets:precompile deployment

2011-09-10 Thread Michael Rigart
@jim: precompiling them locally seems indeed the best way at the moment. But I'm still curious what the reason is that precompiling on server takes that long. I'm setting up a test so I can investigate it a bit further. But thanks for the tip, it's a nice workaround. @aldo: I also use the defau

[Rails] rails 3.1 assets:precompile deployment

2011-09-09 Thread Michael Rigart
Hi all, I'm just deploying a few rails apps after upgrading to rails 3.1. I have implemented the asset pipeline and everything works ok. I'm deploying using Capistrano with the pre fabricated deploy/assets recipe. The problem I encounter is that the rake task takes like forever to precompile al

[Rails] Rails 3.1 asset pipeline

2011-09-02 Thread Michael Rigart
Hi, I just upgraded my existing rails 3.0.10 app to 3.1 where I wanted to try the new asset pipeline. Everything seemed to work fine in development, all the assets are served correctly. But when I wanted to test in production, the paths to the assets changed back to the old format without the di

[Rails] Re: Railties config.time_zone

2011-07-21 Thread Michael Rigart
7;Brussels' end But still it is unclear to me if this is the expected behavior. Michael Rigart wrote in post #1011396: > Hi, > > I have stumbled upon a small issue regarding the use of Railties > (Engine) and setting the time_zone. > > It seems when I set the time_zone in

[Rails] Railties config.time_zone

2011-07-18 Thread Michael Rigart
Hi, I have stumbled upon a small issue regarding the use of Railties (Engine) and setting the time_zone. It seems when I set the time_zone in my engine like: class Engine < Rails::Engine config.time_zone = 'Brussels' end The actual time zone in the application is set back to the default 'U

[Rails] Rails 3 engines testing

2010-10-12 Thread Michael Rigart
Hi, does anyone can help me by telling how you can properly test rails 3 engines? Since engines don't necessarily have db connections on its own, how can you test your models? I could use a test database, but how do you configure you test then to create and use that connection? Thank you in adva

[Rails] Rails 3 engines testing

2010-09-30 Thread Michael Rigart
Hi all, I was wondering how you can test Rails 3 engines. Looks like the rake test task is not available by default. So I added the following in my rake task require 'rake/testtask' Rake::TestTask.new do |test| test.pattern = 'test/**/*_test.rb' test.libs << 'test' end In my test_helper.rb

[Rails] Re: Rails 3 generators

2010-06-18 Thread Michael Rigart
it looks like it has something to do with my namespacing. When I create a second generator without namespaces, everything seems to work fine. Does anyone know what to do in case of namespacing? -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to

[Rails] Rails 3 generators

2010-06-18 Thread Michael Rigart
Hi, I'm having some problems running a self made generator. When I want to list the generators with: rails g, my generator shows up in the list. But when I want to run it, I get Could not find generator error. module MyGem module Core class InstallGenerator < Rails::Generators::Base

[Rails] Re: Rails 3: link_to with "data-confirm"

2010-06-17 Thread Michael Rigart
Hi Ray, I fixed the problem some time ago, but I'm not sure anymore what the problem was. I know I had some other problems as well, And they where all related to a conflicting javascript library that I developed. It was not conflicting with rails.js but with prototype.js . I know I also upgrad

[Rails] Rails 3: link_to with "data-confirm"

2010-05-22 Thread Michael Rigart
Hi, has anyone experienced any problems with the new link_to and data-confirm in Rails3? It seems when you create a link with instead of link text, an image, the confirm message isn't shown. <%= link_to( image_tag("delete.png", :alt => t("helper

[Rails] Re: Custom resource routes

2010-03-29 Thread Michael Rigart
Art Shayderov wrote: > I didn't see anything like that in Rails Guides. > Of course you can overwrite resource routes but you will lose those > helpers. > I think you can either be Restful or not. You can't go both ways. If > you are Restful, you obey the rules. That's the whole point IMHO. > Other

[Rails] Custom resource routes

2010-03-29 Thread Michael Rigart
Hi all, this might be a dumb question, but how can you produce custom resource routes? Lets say you want to add extra parameters in your url but you want your url to stay pritty? edit_resource_path(:param1 => :value1, :param2 => :value2) => don't need an id in edit. new_resource_path(:param1 =>

[Rails] Re: undefined method on web and not in irb

2010-03-07 Thread Michael Rigart
Frederick Cheung wrote: > On Mar 7, 7:56�pm, Michael Rigart wrote: >> > Fred >> >> unfortunately is does >> > > Is Foo defined in multiple places (some editors leave behind backup > copies of files that Rails loads anyway) ? If you stick a breakpoint > i

[Rails] Re: undefined method on web and not in irb

2010-03-07 Thread Michael Rigart
Colin Law wrote: > On 7 March 2010 19:42, Michael Rigart wrote: >> run it through the browser. > Foo.bars is not valid as Foo is a class not an instance, or is that > just a typo here? It should be something like > foo = Foo.new > then use foo.bars > > Colin @Colin:

[Rails] Re: undefined method on web and not in irb

2010-03-07 Thread Michael Rigart
Frederick Cheung wrote: > On Mar 7, 7:42�pm, Michael Rigart wrote: >> run it through the browser. >> >> Now, when I do it through irb, it returns an empty array as expected. >> Does someone here has any clue how this can happen and what I need to >> look for

[Rails] undefined method on web and not in irb

2010-03-07 Thread Michael Rigart
Hi all I seem to have a small problem in Rails. Lets say I have a class Foo with an habtm association to Bar. So Foo has_and_belongs_to Bars en vice versa. Now, when I do lets say Foo.new Foo.bars, I get an undefined method bars for # when I run it through the browser. Now, when I do it through

[Rails] Re: Polymorphic URL's and Uncountable Resources

2010-01-12 Thread Michael Rigart
Brendon Muir wrote: > Hi everyone, I've noticed an inconsistency in the way rails deals with > uncountable resources and restful routes. > > Basically if you map an uncountable resource rails will append > '_index' to the end of some routes to avoid route clashes between the > routes that deal wit

[Rails] Re: ActiveRecord abstract_class and model inheritance

2009-10-20 Thread Michael Rigart
anyone? -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ 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 fr

[Rails] ActiveRecord abstract_class and model inheritance

2009-10-19 Thread Michael Rigart
Hi everybody, I'm having problems on a testcase that I'm working on. I hope that I can explain the problem properly and that some of you can help me out becouse I'm realy stuck on this one. Ok, I have a Page model that needs to be multi lingual. Therefore I have used a small but nice plugin: htt

[Rails] Re: naming conventions for models / controllers

2009-10-02 Thread Michael Rigart
Hi Marnen thanks for the namespace advice. Going to look into that. Sorry for the mistake about the model names. Has been a long day at the office and need a small break ;) Do you have advice on how do achieve this by modifying application code to a plugin? Thanks -- Posted via http://www.

[Rails] naming conventions for models / controllers

2009-10-02 Thread Michael Rigart
Hi, this might be a stupid question, but is there like a naming convention for base models? Lets say you develop an application where custom work is possible. So you create a core for your application. But for the custom development, you don't want to touch your core code, you want to override /

[Rails] Routing issue

2009-07-25 Thread Michael Rigart
Hi all I'm having finding it difficult finding the proper way to route some pages in my application. The application follows the rest architecture and is closed for non authorized persons. But their are some publicly available pages (normal content pages). These content pages are build dynamical

[Rails] Re: Multilingual model content

2009-05-13 Thread Michael Rigart
Hi, I'm going to take a look at the RailsTranslateColumnsPlugin. Maybe I can get some ideas from there. -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Ta

[Rails] Re: Multilingual model content

2009-05-13 Thread Michael Rigart
Francesc Esplugas wrote: > Taking a look at the code, maintenance and test coverage in my opinion > model_translations > it's a better solution than translate_columns. > > http://github.com/janne/model_translations/tree/master > > On Wed, May 13, 2009 at 9:

[Rails] Re: Multilingual model content

2009-05-13 Thread Michael Rigart
Francesc Esplugas wrote: > On Wed, May 13, 2009 at 8:56 AM, Michael Rigart > wrote: > >> I need multilingual input in my models. Lets say you have a Product >> model. That product contains title, description and price. The price is >> allways the same, but the title

[Rails] Multilingual model content

2009-05-12 Thread Michael Rigart
Hi I'm looking for some insight in a small problem I have. I allready posted this in the Rails I18n forum, but didn't got any respond, so maybe it was just the wrong forum. I need multilingual input in my models. Lets say you have a Product model. That product contains title, description and pri

[Rails] unit test validate boolean

2009-03-13 Thread Michael Rigart
Hi, How do you validate booleans? Normally, I validate them through validates_inclusion_of :is_root, :in => [false, true] But when I test the :is_root attribute against a string, it passes. Here are some examples: passes my test => [0, 1, true, false] (they should pass right?) don't pass =>

[Rails] Re: unit test model validations

2009-03-12 Thread Michael Rigart
Hi, (sorry for the double post). I've been working on some standard methods to test model validations. At this point, I can test on these validations: * validates_presence_of * validates_length_of * validates_format_of * validates_numericality_of But how do you test on the rest of validations

[Rails] Re: unit test model validations

2009-03-12 Thread Michael Rigart
Hi guys. I've been working on my skills the last couple of days. I have shown some improvements but as Colin stated, it is not something that you develop over night. It takes time and practice. But I notice that I'm making progress (maybe less then I expected, but still :) ). Brien, thanks fo

[Rails] Re: unit test model validations

2009-03-11 Thread Michael Rigart
Hi Philip wel I started out by trying to create my tests first, but I just got stuck so I decided to write the model validations. Thats my biggest problem at the moment, I have never developed through TDD. And the main problem isn't realy whether to develop or test first, but how to build my

[Rails] unit test model validations

2009-03-10 Thread Michael Rigart
Hi, since I want to improve my Rails skills, I decided to start using the Rails testing framework. But I find it a bit hard to start testing model validations. Some of my tests don't pass, but I know they must, since I have added the validation in the model. Here is an example: The migration:

[Rails] Re: How to speed up ActiveResource?

2009-03-06 Thread Michael Rigart
Robert Walker wrote: > Michael Rigart wrote: >> I' running in production. I have noticed that development is slower then >> production, but the production speed is still far from acceptable. The >> diffrence between using ActiveRecord and ActiveResource is huge.

[Rails] Re: How to speed up ActiveResource?

2009-03-05 Thread Michael Rigart
Robert Walker wrote: > Michael Rigart wrote: >> Hi all, >> >> I've been experimenting with sharing resources between 2 rails apps with >> AR and I just love it. The only downside is that when using AR, my app >> slows down dramastically. >> >&g

[Rails] How to speed up ActiveResource?

2009-03-05 Thread Michael Rigart
Hi all, I've been experimenting with sharing resources between 2 rails apps with AR and I just love it. The only downside is that when using AR, my app slows down dramastically. Is there a way to speed things up? Some special caching mechanisme that needs to be enabled? Thank you in advance for

[Rails] Re: REST: transfer data between applications

2009-01-16 Thread Michael Rigart
. > > Instead of using plain Net::HTTP, you can use ActiveResource (http:// > api.rubyonrails.org/classes/ActiveResource/Base.html) or REST Client > (http://rest-client.heroku.com/rdoc/). > > On Jan 16, 12:15�pm, Michael Rigart Thanks for the input. I'm usering ActiveResource

[Rails] REST: transfer data between applications

2009-01-16 Thread Michael Rigart
Hi all I'm having trouble finding info on how to tranfser data between 2 rest appliations. I will try to scetch my problem as simple as possible. I store data in my first application. In my first application, users need to login to gain access. The users login with a login form: # my session con

[Rails] Re: Rails 2.2 routing problem

2009-01-09 Thread Michael Rigart
cassiozen wrote: > You could try to use formatted_items_path(:pdf) > > On Jan 7, 6:30�pm, Michael Rigart formatted_items_path nor, formatted_item_path seems to work. Both result in a no method error. -- Posted via http://www.ruby-

[Rails] Rails 2.2 routing problem

2009-01-07 Thread Michael Rigart
Hi all I just upgraded a project of mine from rails 2.1 to 2.2. Becouse of this upgrade, I have a link that doesn't work anymore. I get an error when rendering the page: outgoing_invoice_url failed to generate from {:action=>"show", :override=>true, :controller=>"outgoing_invoices", :id=>"2297.p

[Rails] AR deep clone

2009-01-06 Thread Michael Rigart
Hi all, I'm having problems with cloning an ActiveRecord Object. The object consists of multiple child objects, so when I use the normal clone method, it only clones the attributes of the parent object. Could someone help me out telling me how I can clone the child objects as wel? I have tried l

[Rails] Re: Nested resources deletion

2008-10-05 Thread Michael Rigart
It looks like when the delete action is executed, rails first updates the sub item id to null instead of deleting it :s -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby

[Rails] Re: Nested resources deletion

2008-10-04 Thread Michael Rigart
looks like I solved the problem myself. Looks like when you say delete it sets the id to null. I needed to use destroy. -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby

[Rails] Nested resources deletion

2008-10-04 Thread Michael Rigart
Hi, I managed to get the complex forms and nested resources described in http://railscasts.com/episodes/75-complex-forms-part-3 to work. But I'm having problems when deleting a sub item. def existing_task_attributes=(task_attributes) tasks.reject(&:new_record?).each do |task| attrib

[Rails] REST web service

2008-09-30 Thread Michael Rigart
Hi I have a question regarding using Rails as a REST web service. I understand the concept and have implemented it into a project. As far as I'm logged in into the application, I can pull out data in any format that is specified in the application. But lets say that I want to use it as a servic