I want to test that something
receives #var
from inside the block.
I realize this might be a code smell.
something = Struct.new(:var).new
some_method do
something.var
class ProductsController < ApplicationController | |
def search | |
Product.search do | |
fulltext 'cities' | |
with :used, false | |
end | |
end | |
end |
Product.where("name LIKE '%?%'", 'cities').all |
# citi is the stem of cities | |
citi => city | |
# copi is the stem of copies | |
copi => copy |
gem 'sunspot_rails' | |
gem 'sunspot_solr' # optional pre-packaged Solr distribution for use in development |
bundle |
rails g sunspot_rails:install |
rake sunspot:solr:start |
class RailsTextPostRenderer | |
def initialize(context) | |
@context = context | |
end | |
def render(model) | |
@context.render(partial: "/posts/text_body", locals: {post: model}) | |
end | |
end |
function SomeClass() {} | |
SomeClass.prototype.do_it = function() { alert('doin it!'); } | |
s = new SomeClass(); | |
function Decorator(klass) { this.__proto__ = klass.__proto__; } | |
d = new Decorator(s) | |
d.do_it() |