How do I set Ruby Sequel logging to the DEBUG level?
The default Ruby Sequel behaviour is to log all DB queries at the INFO level (unlike ActiveRecord which logs at the DEBUG level). How do I change this? ...
The default Ruby Sequel behaviour is to log all DB queries at the INFO level (unlike ActiveRecord which logs at the DEBUG level). How do I change this? ...
About 6 months ago I switched from TextMate to MacVim for all of my development work, which primarily consists of coding in Ruby, Ruby on Rails and JavaScript. With TextMate, whenever I needed to run a spec or a test, I could just command+R on the test or spec file and another window would open and the results would be displayed with t...
I am responding to a POST from a server that I don't control, and all the params[] come in as Tempfiles - which I can work around. (I am running on thin here at my desktop mac). The whole method works, but at the last line I have: render :nothing => true As there is nothing to render. It is in this render :nothing => true call that rai...
I have this @project.posts.count => 11 @project.articles.count => 5 >> a = @project.articles.map(&:signup_id) => [6, 8, 10, 12, 14] I want to only display the project posts that dont have an id of the following [6, 8, 10, 12, 14]. So i want display the posts that dont have an article.signup_id @project.posts #so reject if id is ...
Hi, I'm making a Cross-platform mobile app, with the fantastic framework "Rhodes". But how am i getting people to connect through facebook..? So what i wan't is, people should connect to facebook first in the application, and when they done that, it shoulld sync with the facebook app(that app, are made). So i just want to make a connect...
I have a connection open and am doing: values = [1, 'test'] connection.return_response_as_xml = true response = connection.send(method_name.to_sym(), *values) and that works fine and all. but I want to see the raw request sent across... is this possible? ...
>> a => [6, 8, 10, 12, 14] >> @project.posts(:all, :conditions => [ "id not in (?)", a ]) => [#<Post id: 6,........ Why is this not filtering the POst with id of 6 ...
My question is pretty simple: how is event-driven programming actually achieved? To elaborate: I have a Rails application, every time a user makes a change on the website, the model writes that "change" to a text file (as JSON.) What I'd like to do is hook an IRC bot to that "event." (the creation/modification of the text file.) How i...
I am attempting to set up some UI testing in Watir for our web application. I'm running into trouble getting the click events to propagate. We are using EXTJS to make tabs, which are spans in the resulting html. If I select a span like this it works: span1 = @browswer.span(:text=>"Tab Name") span1.click The trouble is when I have...
I want to create a bit, that will contain security permissions for a given user. In c#, I would do this by creating an enumeration, and then I would do some bit banging on the binary value, by anding '&&' to see if it results in a TRUE value. How can I do this best in Ruby? ...
I'm using the jeweler gem when developing new gems. As part of the skeleton, it sets up a set of RDoc related rake tasks - the main one being rake rdoc. As far as I can tell from the Rakefile, this task uses the rake/rdoctask library to generate HTML documentation from my RDoc comments. It tries intelligently to make references to class...
Is there any specific difference between these conditions? 1) begin acct = 1 return 0 end unless self.l_acct.nil? 2) unless self.l_acct.nil? acct = 1 return 0 end ...
i install bluepill on ubuntu: Linux auto 2.6.31-14-server #48-Ubuntu SMP Fri Oct 16 15:07:34 UTC 2009 x86_64 GNU/Linux Actual Result: root@auto:/# gem install bluepill Successfully installed bluepill-0.0.43 1 gem installed Installing ri documentation for bluepill-0.0.43... Installing RDoc documentation for bluepill-0.0.43... root@aut...
Hi so in ruby im trying to make a program that takes an argument and returns the date exactly "x" number of months ago, I got it to say the year month and date but couldn't get it to display the hours minutes and seconds. any suggestions? Thanks require "Time" require "Date" class "Time" def months_ago(n) y = Time.now.year d = Time.now....
I don't really understand the pro's and con's of using "post" vs "get" vs "put" requests, on custom controller actions, and whether to use links or forms/buttons. So let's say I have a simple to-do list with tasks, and a tasks controller, and I want a "complete" action where I find a specific task in the db and update it's status attri...
Bundler will automatically install any dependencies for the specified gems, it doesn't however output which dependencies map to which gems in the standard output. That information is useful when one of the dependencies fails the installation. Is there a way to set bundler to be more verbose and inform about the dependencies while instal...
Forgive me if I've got my terminology wrong; I am still quite new to Ruby and Rails. For school I am working on an RoR project as part of a team. I was pair programming with a teammate, who actually happens to be experienced in RoR; and I wrote something like the following: d = self.deliverables.find_all_by_lifecycle_id(self.lifecycle_...
I'm looking for a good, solid reference for proper RDoc syntax. Recommendations? I can't seem to find anything that clearly shows: How to document class methods and their parameters How to document what a class or class method does. Update 1 I found a similar question with a great answer and I wanted to reference it here: http://sta...
I am currently using the following: 20: <p>Status: <%= @contact.try(:status) unless @contact.nil? || @contac t.status.nil?%></p> However, I still get the following error: ActionView::TemplateError (undefined method `status' for nil:NilClass) on line # 20 of app/views/contacts/show.html.erb: Is there a better way to be check...
In a unit test I need to test whether alias methods defined by alias_method have been properly defined. I could simply use the same tests on the aliases used for their originals, but I'm wondering whether there's a more definitive or efficient solution. For instance, is there a way to 1) dereference a method alias and return its original...