Hrm, if I have an activerecord model that has named scopes which are the same name as native attributes to the model, is there a sane way for me to access the attribute and bypass the scope? In normal usage such as: Object.name -- this triggers the `name` scope and not accessing the `name` attribute. Need a way to force accessing the attribute of the object and not use the scope.
HAML problem: '%table.table.table-bordered.table-hover.tablesorter#kittens' -- How can I make HAML interpolate this so that the '#kittens' part can be dynamic instead of me hardcoding it?
So a large part of my code involves munging data into a SQL database using Sequel, and the bulk of this code looks like: DB.insert(:value1 => object.value1, :value2 => object.value2) but far more substantial with how much I'm inserting similarly named properties of an object into columns of the database. Is there a better pattern?
Hmmm...I don't follow how that would work with regard to insertion via Sequel.
So a common pattern in my code is to define an empty array before iterating through an Enumerable and then appending the result of a method called from within the Enumerable's block into the array. I feel like maybe there's a better more Rubyesque way to handle this common need/pattern?