[Link to the Single hash](#single-hash).
[Link to the Double hash with parens](#double-hash-with-parens).
[Link to the Single hash](#single-hash).
[Link to the Double hash with parens](#double-hash-with-parens).
describe Pasta do | |
describe "#sauce_name" do | |
describe "when initialized with sauce_type = 2" do | |
let(:pasta) { Pasta.new(2) } | |
it "returns \"pesto\"" do | |
assert_equal(pasta.sauce_name, "pesto") | |
end | |
end | |
end |
var $ = require("jQuery") | |
, Delegator | |
; | |
Delegator = function () { | |
this.$el = $("<p/>"); | |
} | |
// Add a function to the object that delegates to a property on the same object. | |
// |
def sent? | |
self.status == "sent" | |
end |
# this is the code I used to determine the csv_path to use when using Paperclip with Amazon S3 AWS | |
# necessary because my development environment doesn't upload to S3 | |
# get an object that has_attachment with Paperclip | |
object = ModelWithPaperclip.last | |
# use url if no file exists at path | |
csv_path = File.exists?(object.csv.path) ? object.csv.path : object.csv.url | |
# this should probably be implemented as a model method |