Sequel already has a way to do that: Policy[:name => name] You cna therefore drop this method