- build-essential
- libxml2
- libxml2-dev (for nokogiri)
- libreadline6
class ApplicationController < ActionController::Base | |
# Creates an accessor which is exposed to the view | |
def self.view_accessor(*names) | |
attr_accessor *names | |
helper_method *names | |
end | |
end |
# Original | |
defmodule Service.WebhookHandler do | |
def register_webhook(name) do | |
case Registry.register(webhook_id(name), __MODULE__) do | |
{:ok, _pid} -> :ok | |
error -> error | |
end | |
end | |
class ApplicationController < ActionController::Base | |
# ... | |
concerning :Presenters do | |
included do | |
helper_method :present | |
end | |
def present(record_or_array, klass) | |
if record_or_array.respond_to?(:map) |
env: | |
browser: true | |
es6: true | |
extends: 'eslint:recommended' | |
parserOptions: | |
sourceType: module | |
rules: | |
indent: | |
- error | |
- 4 |
@import "globals"; | |
custom-element { | |
--custom-var: $primaryColour; | |
} |
require "yaks" | |
Book = Struct.new(:title, :author) | |
book = Book.new("Leviathan Wakes", "James A Corey") | |
class BookMapper < Yaks::Mapper | |
type "book" | |
attributes :title |
require "yaks" | |
Book = Struct.new(:title, :author) | |
book = Book.new("Leviathan Wakes", "James A Corey") | |
class BookMapper < Yaks::Mapper | |
type :book | |
attributes :title |
44) User previous_visit_at first time another call right after still has no value | |
Failure/Error: let(:user) { Fabricate(:user) } | |
NoMethodError: | |
undefined method `first' for nil:NilClass | |
# ./lib/pretty_text.rb:122:in `block in markdown' | |
# <internal:prelude>:10:in `synchronize' | |
# ./lib/pretty_text.rb:119:in `markdown' | |
# ./lib/pretty_text.rb:175:in `cook' | |
# ./app/models/user.rb:424:in `cook' | |
# /home/andrew/.rbenv/versions/1.9.3-p362/lib/ruby/gems/1.9.1/gems/activesupport-3.2.12/lib/active_support/callbacks.rb:429:in `_run__4302418198468556500__save__3765986560144774874__callbacks' |