I\'m working through the \'Ruby On Rails 3 Essential Training\' and have received a problem when using name scopes. When finding records and using queries withing the Rails
The scope's body needs to be wrapped in something callable like a Proc or Lambda:
scope :visible, -> { where(:visible => true) }
The reason for this is that it ensures the contents of the block is evaluated each time the scope is used.