Skip to content

{ Category Archives } Uncategorized

Django F() And Q() Objects For Rails

Recently I was browsing

Django
documentation deliberately looking for
some ideas to cross-pollinate to Rails. F() and Q() objects looked like
nice little hacks so I decided to implement [...]

Tagged , ,

Rails Pro Tip: Invoke Command Line Commands From Rails Console

So there you have your command line prompt from Bash/Zsh/cmd.exe and
there is so called

Rails console
which is basically IRB prompt with the Rails application loaded.

[...]

Tagged ,

Safe String Interpolation In Ruby

Age-Old Problem

Suppose you want to authenticate user from the login/password entered
on the web from

user = User.first(:conditions => "login = ‘#{ login }’ AND password = ‘#{ password }’")

[...]

Tagged ,

Travel To The Core Rails 3 Methods Without Leaving IRB Prompt

In the previous post I
introduced Reflexive gem
which lets you browse the classes and modules for running application with
Web UI. But we’re really often just goofing off at the IRB prompt, aren’t
we? For this [...]

Reflexive: Live Class And Source Code Browser

Background

Recently I was trying to understand how the
Arel (Relational Algebra for Ruby)
internals work.

The project has strong OO design and uses some metaprogramming techniques.
Main code base consists of ~ 80 files, with files having 30
LOCs on average.

I’m totally cool with [...]