[Rails] assert_template changed behaviour from 3.x to 4.0.x

2014-02-21 Thread Jarl Friis
Hi. I have a situation where the user is POSTing to the controller and the controller will 1) send an email using a view template 2) respond xml over HTTP response without using a view template The test contains a line with assert_template '' which verifies that no template is used for HTTP

[Rails] Anybody running Rails on eCryptFS

2012-10-03 Thread Jarl Friis
If anyone is using Rails on eCryptFS then this Pull Request might have interest Currently Rails fails (in a rare sistuation) on eCryptFS The Pull Request solves that problem. Jarl -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post

Re: [Rails] Re: Selecting only a subset of columns.

2010-10-15 Thread Jarl Friis
Jarl Friis j...@gavia.dk writes: Thanks Xuan and Colin for your attention. Xuan xua...@gmail.com writes: You may try adding a default_scope :select='id, name, etc' to your model. This would accomplish what you are looking for, That was exactly what I was looking for. My actual

[Rails] Selecting only a subset of columns.

2010-09-07 Thread Jarl Friis
Hi. In many areas in the AR API you can specify a :select option to select only a subset of columns. Is there any way to change the default selected columns (which is *) to a subset of columns for a whole model. such that when I write Model.find(1) it gives me an instance with only, say 3 (out

[Rails] Reports in rails app

2010-08-13 Thread Jarl Friis
Hi. I am looking for some reporting library for rails. Does anyone have experience with such libraries, until now I have found * Ruport (Ruby reports) (http://www.rubyreports.org/) * reportable (http://github.com/saulabs/reportable) * ReportBuilder

[Rails] respond partial content

2010-07-06 Thread Jarl Friis
Hi. This may seem like an absurd request. However it is becausy I integrate with a legacy system. I am in the need to respond partial content (flush) before the action is fully complete. This should prevent the legacy system to timeout. I need to send HTTP headers and some content (to indicate

[Rails] AR private methods.

2010-06-10 Thread Jarl Friis
Hi. I have an AR model named Order, and a field in the DB named expired. I dont want this field to be modified from outside the model. Therefore I have declared a private method expired=(value) in my Order model. This works fine in development and production; If I call o.expired = nil I get a

Re: [Rails] Re: console ThreadError (thread ... tried to join itself)

2010-05-28 Thread Jarl Friis
pfs pontus.stromd...@gmail.com writes: m. this is not a snow leopard issue, try running script/console production and it will work. Because you need to have config.cache_classes set to true in the environment, and development you probably want to that turned off. Take a look at this. Seems

[Rails] Problems using exception_notification 2.3.3.0

2010-05-06 Thread Jarl Friis
Hi. I am using rails 2.3.5 I just installed exception_notification 2.3.3.0 using 'sudo gem install exception_notification' I have add config.gem exception_notification in environment.rb and 'include ExceptionNotification::Notifiable' in application_controller.rb Now I am trying it out in

[Rails] Best practise using unit_record, mocha, and shoulda

2010-04-19 Thread Jarl Friis
Hi. I would like to start using unit_record (in combination with shoulda and mocha) I would however like to share some experience and best practise about this with others. Does anybody else here on the list use this setup? Jarl -- You received this message because you are subscribed to the

[Rails] Best practise for non-us formated numbers in parameters.

2010-03-04 Thread Jarl Friis
I have a contrller that receives data (by POST requests) from an external system. The external system formats the number according to danish traditon, that is PI=3,1415, and 3/4 = 0,75. This gives me problems in my activerecord when specifying these attributes to numeric, that is using

Re: [Rails] Re: How to create a UNIQUE table constraint with migrations.

2010-03-03 Thread Jarl Friis
Robert Walker li...@ruby-forum.com writes: Jarl Friis wrote: Philip Hallstrom phi...@pjkh.com writes: CREATE TABLE properties ( add_index :properties, [:namespace, :name], :unique = true After trying this and opening my interactive SQL prompt (psql), I can see that this only creates

Re: [Rails] How to create a UNIQUE table constraint with migrations.

2010-03-03 Thread Jarl Friis
Philip Hallstrom phi...@pjkh.com writes: Philip Hallstrom phi...@pjkh.com writes: On Feb 24, 2010, at 11:17 AM, Jarl Friis wrote: Hi. This must be the most obvious thing to do, but I just can't seem to find examples of how to do this. I would like to create a table with a table unique

Re: [Rails] How to create a UNIQUE table constraint with migrations.

2010-03-03 Thread Jarl Friis
Philip Hallstrom phi...@pjkh.com writes: Hi. This must be the most obvious thing to do, but I just can't seem to find examples of how to do this. I would like to create a table with a table unique constraint on database level. In deed some migration code that would generate the following

Re: [Rails] How to create a UNIQUE table constraint with migrations.

2010-03-02 Thread Jarl Friis
Philip Hallstrom phi...@pjkh.com writes: On Feb 24, 2010, at 11:17 AM, Jarl Friis wrote: Hi. This must be the most obvious thing to do, but I just can't seem to find examples of how to do this. I would like to create a table with a table unique constraint on database level. In deed some

[Rails] How to create a UNIQUE table constraint with migrations.

2010-02-24 Thread Jarl Friis
Hi. This must be the most obvious thing to do, but I just can't seem to find examples of how to do this. I would like to create a table with a table unique constraint on database level. In deed some migration code that would generate the following SQL CREATE TABLE properties ( namespace

[Rails] Re: Which plugin to use for (image) files

2009-09-07 Thread Jarl Friis
Thanks for your comment Philip. Philip Hallstrom phi...@pjkh.com writes: I am looking for a plugin to handle files (images actually). Here is a list of features that I would like 1) I would like many images for a single model. (has_many) 2) I would like to store images in several

[Rails] How do I make a performance test?

2009-09-06 Thread Jarl Friis
Hi. I would like to make a performance test using rails 2.3.3 I see there is a generator called performance_test, but can someone give me a link to a url that gives some examples. I have read http://guides.rubyonrails.org/performance_testing.html To me however a test is something that either

[Rails] Which plugin to use for (image) files

2009-09-04 Thread Jarl Friis
Hi. I hope I don't start a religiuos war now. I am looking for a plugin to handle files (images actually). Here is a list of features that I would like 1) I would like many images for a single model. (has_many) 2) I would like to store images in several resolutions (automatically) 3) I would

[Rails] Re: Asserting PUT methods

2009-08-28 Thread Jarl Friis
Jason Stewart jason.m.stew...@gmail.com writes: You can do something like assert_select a[onclick=?], /regexp here/ Yes, for now I have made like this: assert_select a#{PUT}[href=?], order_path(order, :update_timestamp = true) and I have declared PUT in test_helper like this: PUT =

[Rails] Re: Setting @request.env[HTTP_REFERER] in an integration test

2009-08-28 Thread Jarl Friis
Thanks david. David Angga carsmetic...@gmail.com writes: 1. (*) text/plain ( ) text/html you can do it like this: @headers ||= {} @headers[HTTP_REFERER] = previous_link_url get/put/post some_link_url, nil, @headers hope this would help you. Well I got that far my

[Rails] A resource named image gives problems

2009-08-28 Thread Jarl Friis
Hi. I can't be the only one in the world having the wonderful idea to have a resource named image. I have a controller named images_controller I have a route named image, and therefore a helper called image_path(id). But using image_path in an action view erb file gives problems, there

[Rails] Asserting PUT methods

2009-08-27 Thread Jarl Friis
Hi. In my view I have a line like this: link_to('Update timestamp', order_path(@order, :update_timestamp = true), :method = :put This generates HTML like this a href=/orders/2131771394?update_timestamp=true onclick=var f = document.createElement('form'); f.style.display = 'none';

[Rails] Setting @request.env[HTTP_REFERER] in an integration test

2009-08-27 Thread Jarl Friis
Hi. I would like to set @request.env[HTTP_REFERER] in an integration test, but due to its nature, I would naturally set this value to the previousle request url. How do I do that. Thanks. Jarl --~--~-~--~~~---~--~~ You received this message because you are

[Rails] Re: Integration testing edit actions (PUT method)

2009-05-13 Thread Jarl Friis
Starr Horne st...@chatspring.com writes: What does people do here? ignore the fact that the integration test generate HTTP request which differs from what a broswer will do, or do you use post (or post_via_redirect) and adding the _method parameter manually. I think you're just splitting

[Rails] Re: CookieStore and setting an expiration

2009-05-05 Thread Jarl Friis
etienne pelap...@gmail.com writes: That overwrites the cookie for the session. By the time they attempt to login, a session has already begun for them. CookieStore is doing the management behind the scenes. I want to amend the cookie to have an expiration date which, it seems, it does not

[Rails] Re: How to integration test forms with multiple models

2009-04-29 Thread Jarl Friis
Jarl Friis j...@gavia.dk writes: Hi. I try to create an integration test for a form that updates two models (order and floorplan), Creating a functional test for this situation works fine, however I cannot build an equivalent integration test. I figured out that this was a bug in rails

[Rails] Re: Travel Salesman Problem

2009-04-28 Thread Jarl Friis
Arthur Chan rails-mailing-l...@andreas-s.net writes: Thanks guys, I kinda understood the basic idea of the TSP. i wanna do something like heuristic functions. Or, something like: http://www.ruby-forum.com/topic/127031#new I don't know if the grid method mentioned is applicable for

[Rails] Re: Rails2 Documetation.

2009-04-28 Thread Jarl Friis
Conrad Taylor conra...@gmail.com writes: First, I would highly recommend getting a good book. Thus, I would recommend getting a copy of Agile Web Development with Rails 3rd by Dave Thomas et al. Yes, this is indeed a good book. Just one con: it develops the application before writing the

[Rails] How to integration test forms with multiple models

2009-04-27 Thread Jarl Friis
Hi. I try to create an integration test for a form that updates two models (order and floorplan), Creating a functional test for this situation works fine, however I cannot build an equivalent integration test. My master model (order) contains has_many :floorplans

[Rails] Re: Travel Salesman Problem

2009-04-27 Thread Jarl Friis
Robert Anderson ranom...@gmail.com writes: 1. (*) text/plain ( ) text/html Start here: http://en.wikipedia.org/wiki/A*_search_algorithm This algorithm finds shortest path from initial node to goal node. TSP (Traveling SalesMan) is aobut visiting all nodes in a graph.

[Rails] Using collection on has_many with :conditions.

2009-04-20 Thread Jarl Friis
Hi. I have a has_many relation with a hashed condition, taking from the RI doc: :conditions Specify the conditions that the associated objects must meet in order to be included as a WHERE SQL fragment, such as price 5 AND name LIKE 'B%'. Record creations from

[Rails] Re: How to assert a specific layout.

2009-04-10 Thread Jarl Friis
Jarl Friis j...@gavia.dk writes: Hi. Can any test-guru help me on this one. Certainly there was. Thanks for all the answers, also all the posts regarding alternatives. I will have a look at all this. Jarl --~--~-~--~~~---~--~~ You received this message

[Rails] Re: how to check the config.action_controller.session options ?

2009-04-06 Thread Jarl Friis
Kad Kerforn wrote: when setting it in my environment.rb config.action_controller.session = { :session_key = '_myapp_session', :secret = '3a64394bb895f1f05e0c07f71127d93d' } I cannot get it back in the script/console .. :session_key=_session_id !!! why ?

[Rails] Is ruby 1.9.1 supported by Rails 2.3.0 ?

2009-03-24 Thread Jarl Friis
Hi. It seems like many people have had success using rails 2.3.0 with ruby 1.9.1. And as far as I know one of the goals of rails 2.3.0 was to support ruby 1.9.1. But on http://rubyonrails.org/download, ruby 1.8.x is still recomended and ruby 1.9.1 is not even mentioned. Is that because the

[Rails] Re: Is ruby 1.9.1 supported by Rails 2.3.0 ?

2009-03-24 Thread Jarl Friis
Conrad Taylor conra...@gmail.com writes: Jarl, the current release version of Rails is 2.3.2. Thus, you might to take a look at the following: http://guides.rubyonrails.org/2_3_release_notes.html#ruby-191-support Next, if your rails application(s) requires certain gems and/or plugins,

[Rails] Re: assert XSD validity

2008-11-21 Thread Jarl Friis
Frederick Cheung [EMAIL PROTECTED] writes: Does both as far as I know ( I only had an xsd anyway) Thanks. the xmllint help says --schema schema : do validation against the WXS schema I have never seen WXS as an abreviation for XML Schema Definition files. I now made a small rails test helper

[Rails] assert XSD validity

2008-11-19 Thread Jarl Friis
Hi. I am working on a webservice producing xml content, In my rails functional test I would like to assert that this generated xml (@reponse.body) conforms to a specific XSD. What is the best approach to do this? Jarl --~--~-~--~~~---~--~~ You received this

[Rails] Re: Can't run tests using ruby 1.9.0 and rails 2.1.2

2008-11-13 Thread Jarl Friis
James Byrne wrote: Yugui (Yuki Sonoda) announced the release of Ruby 1.9.1-preview 1: This is a preview release of Ruby 1.9.1, which will be the first stable version of the Ruby 1.9 series. Ruby 1.9.0 was a developmental release only. That was always made quite clear. Thank

[Rails] Re: missing sourcefile (no such file to load)-- squlite3 error

2008-11-12 Thread Jarl Friis
Ryan Bigg wrote: Rails 2.0.2 uses sqlite3 by default. Either you: 1. Install sqlite and install the sqlite-ruby gem. You probably mean sqlite3-ruby. At least that worked for me. -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received

[Rails] Re: Can't run tests using ruby 1.9.0 and rails 2.1.2

2008-11-12 Thread Jarl Friis
Frederick Cheung wrote: On 12 Nov 2008, at 11:32, Jarl Friis wrote: I have just created my first rails app After having modified the generator script (see http://rails.lighthouseapp.com/projects/8994/tickets/1176-scriptserver-make-an-error-in-ruby-19-because-of-defined-methods-change ) I

[Rails] Can't run tests using ruby 1.9.0 and rails 2.1.2

2008-11-12 Thread Jarl Friis
I have just created my first rails app After having modified the generator script (see http://rails.lighthouseapp.com/projects/8994/tickets/1176-scriptserver-make-an-error-in-ruby-19-because-of-defined-methods-change ) I have created controller and I now try to run the generated test, so I do:

[Rails] Re: Can't run tests using ruby 1.9.0 and rails 2.1.2

2008-11-12 Thread Jarl Friis
Thanks for the response. Frederick Cheung wrote: On 12 Nov 2008, at 14:12, Jarl Friis wrote: so I do: ruby 1.9 is somewhat in flux. You'll want to be on edge rails to use it. Sorry english is not my native language and I am completely new ruby AND rails. What do you mean