On Saturday, June 2, 2012 8:44:40 AM UTC-7, cyx wrote:
>
> Hi, 
>
> I'm currently using Sequel, but very minimally and try to avoid any 
> sort of magic 
> when I can. That means basically: 
>
> - for insert / update / deletion of models 
> - basic associations 
>
> For anything more complex (i.e. joins), I prefer to write the SQL by 
> hand, as 
> it's easier to analyze and to debug code later on. 
>
> With that out of the way, what I'm doing is something like: 
>
> DB.fetch("SELECT ....").map do |dict| 
>   Item.new(dict, true) 
> end 
>
> That works fine, but I'm using a deprecated boolean flag (from_db), 
> which 
> makes me feel like I'm doing something hackish. 
>

Switch to doing:

  Item.call(dict)
  # or
  Item.load(dict)
 
load just calls call, but it's slightly more descriptive.

Jeremy

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/sequel-talk/-/buybY1-sRAMJ.
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.

Reply via email to