1
2
3
class MyModel
  named_scope :not_hidden, :conditions => ['hidden IS NULL OR hidden = ?', false]
end

Ruby On ActiveRecord: named_scope f...

by mislav, June 19, 2008 19:46

When you have to support NU...

8f93a872e399bc1353cc8d4e791d5401 Talk
1
2
3
class MyModel
  named_scope :not_hidden, :conditions => { :hidden => false }
end

Ruby On ActiveRecord: named_scope f...

by mislav, June 19, 2008 19:44

When NULL value is not allo...

8f93a872e399bc1353cc8d4e791d5401 Talk
1
2
3
class MyModel
  named_scope :not_hidden, :conditions => ['hidden IS NULL OR hidden = 0 OR hidden = ?', 'f']
end

Ruby ActiveRecord: named_scope f...

by mislav, June 19, 2008 18:46, 7 refactorings, tagged with named_scope boolean

Can ActiveRecord be used to...

8f93a872e399bc1353cc8d4e791d5401 Talk
1
2
3
4
require 'erb'

# GOAL: render the template with the following vars
...

Ruby Given a hash of variables, ...

by mislav, April 12, 2008 15:12, 3 refactorings, tagged with erb, singleton, metaclass, metaprogramming, hash, render

This works. Now, is there a...

8f93a872e399bc1353cc8d4e791d5401 Talk