On Jul 24, 1:53 am, Clive Crous <[email protected]> wrote: > Hi, > > Jeremy posted a while ago about how using functions like this: > :max[:foo ] > will not work in ruby 1.9. > > Unfortunately I've been unable to find that discussion in this list's > history. Here is my exact line of code I'd like to move from a ''.lit > to something more rubyish, it's for postgres and has pgcrypt module > installed in the database ( migration 001 installs it :D ) > > char :code, :size => 64, :null => false, :unique => true, > :default => %{encode(digest('somethingsalty-'||now(),'sha256'),'hex')}.lit
:default=>:encode.sql_function(:digest.sql_function (['somethingsalty-', :now.sql_function].sql_string_join, 'sha256'), 'hex') Note that using .lit isn't necessarily a bad thing, especially in this case where you are tied to a specific database anyway. Jeremy --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sequel-talk" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/sequel-talk?hl=en -~----------~----~----~----~------~----~------~--~---
