RubyFlow The Ruby and Rails community linklog

×

The Ruby and Rails community linklog

Made a library? Written a blog post? Found a useful tutorial? Share it with the Ruby community here or just enjoy what everyone else has found!

Submit a post

You can use basic HTML markup (e.g. <a>) or Markdown.
Note that your post may be edited to suit the format of the site.

As you are not logged in, you will be
directed via GitHub to signup or sign in

Post Preview

Note: Only the first pargraph is shown on the front page and overly long paragraphs may be broken up.

Ruby and Metaprogramming

Ruby is a lang that supports Metaprogramming effectively, and might be the best in that field. If you want to explore more on that topic, and how ruby can help you, then check this list of posts i wrote recently, i hope you will enjoy them

Nice tutorials, another great resource is the pragmatic programmers videos on m…

Why setting the default value of a Hash to be a Hash is wrong (use a block instead)

A quick tutorial on how to make the default of a hash a hash.

dude the text on your website is waaaaaaaaaaay too small, can hardly read it wi…
Indeed, I have to second that.
Noted. Thanks for the feedback. I’ve increased the font size on my site to m…
Interesting (and wierd!) language behaviour, ill look out for that when using h…

Fixjour: Another object mother

If nothing has felt quite right to you so far, check out Fixjour. It gives you the new_[model], create_[model] and valid_[model]_attributes methods and nothing else. Check out the README for more info.

http://www.fitflops.in.net http://www.mlbjerseyscom.us.com http://www.coachoutl…

Leverage ActiveRecord with Non-Database Backed Objects

ActiveRecord comes with a lot of nice things that aren’t dependent on having a database backed model. The most obvious example of this is the validation framework baked into ActiveRecord. Also, there are several plugins which add some useful behavior to ActiveRecord objects but don’t rely on having a database. [more inside]

Scope Columns

ColumnScope to select only certain values from your DB. I often need only single attributes of an ActiveRecord instance. In the past I used something like select_values(SELECT_SQL) or find(:all, :select => SELECT_SQL_FRAGMENT).map! { |r| [r.title, r.teaser]} to conservativly get them. After some time I felt the redundant code tiring and wrote this tiny plugin on top of named scopes. Usage examples: Article.selects(:title_and_teaser).with_author.all # => [<Article ...] Product.ordered_by_name.select_all(:name_and_prize) # => [['Apple Pie', 3.80], ...] You can find the source and more examples in my repository @ github.

Lockdown improvements

I’m working on a new version of Lockdown and would like to hear of any suggestions. more info…

it would help if you told us what lockdown is…
Yeah…great point. I guess I was trying to keep it a little too short. It’s …

In light of the Rails/Merb merge, how DHH is still being a jerk

http://skein.tumblr.com/post/66709064/its-about-the-ecology-stupid - The Rails/Merb merge isn’t necessarily a bad idea. But rails-core needs to actually have a conversation about why people (a number of merbists) were so pissed off at the rails community that they left. And that can’t happen until someone acknowledges that there was a legitimate problem.

oh :P rubyflow doesn’t automatically interpret urls. …
Thanks for adding the link, invisible RubyFlow editor! (Peter i presume) :) …
Yesh.. thanks for posting! :)
why is it necessary to talk shit about someone? If DHH wants to make himself lo…

Valid Attributes and Records for Unit/Integration testing

valid_attributes a Rails plugin that produces valid Records and attributes from a given yml file. user = valid User #reord (unsaved) strange_user = valid User, :name=>'Mr Strange' #slightly modified version... Also Included: assert_invalid_attributes, a validation to test all validation rules DRY and with readable output. #--> Failure: User.email expected to be invalid when set to s@sss asser_invalid_attributes User, :email=>[nil,'','s@sss','xx@dd.s'], ...

Ruby reflection 2

This is the second post related to ruby’s reflection API, the previous post was an extensive intro to this topic. While the current one will be lighter somehow, it would require you to focus a bit more on the content. Here we go:

Loading older posts