I hereby claim:
- I am norman on github.
- I am compay (https://keybase.io/compay) on keybase.
- I have a public key whose fingerprint is 1A08 8ED4 32C3 612F 5FF5 677E 74BA BFD3 3159 0D75
To claim this, I am signing this object:
| strings = %w[aa áb ac na ña ne oa] | |
| # Provide alphabetical sort in Spanish, where accented vowels are sorted | |
| # the same as unaccented vowels, and "ñ" is sorted directly after "n". | |
| # | |
| # This is accomplished by normalizing the string to Unicode decomposed form | |
| # to break characters with diacritics into multiple characters, and then | |
| # removing acute accents and diaresis: e.g. "á" becomes "a", "ü" becomes | |
| # "u". These are the only two diacritics used for vowels in Spanish. | |
| # |
| # frozen_string_literal: true | |
| require "rails_helper" | |
| describe "Fixtures" do | |
| fixture_table_names.each do |table_name| | |
| model_class = table_name.singularize.classify.constantize | |
| it "has valid #{table_name}" do | |
| expect(model_class.all).to all be_valid | |
| end |
I hereby claim:
To claim this, I am signing this object:
| # By default, changes to the layout temnplate won't cause a Rails etag | |
| # to change. I suppose this is to facilitate Turbolinks. Sometimes you | |
| # might want to change an etag in response to changes in the layout - | |
| # this is particularly true when working in development mode. This is | |
| # one way to do it, there are probably other (read: likely better) ways | |
| # to do this too. | |
| class FooController < ApplicationController | |
| # There's probably some API method to get the name of the layout | |
| # rather than hard-coding it like I did here, but I'm too lazy to | |
| # look it up right now. |
| ### Keybase proof | |
| I hereby claim: | |
| * I am norman on github. | |
| * I am compay (https://keybase.io/compay) on keybase. | |
| * I have a public key whose fingerprint is 3059 0FBA AFDE E001 D557 C63A 298B 0120 ED7D 0E39 | |
| To claim this, I am signing this object: |
| #------------------------------------------------------------------------------ | |
| # CUSTOMIZED OPTIONS | |
| #------------------------------------------------------------------------------ | |
| # Add settings for extensions here | |
| # | |
| # Some stupid, dangerous settings only used to speed things up on a local | |
| # development machine, where if data is lost I'll just wipe and recreate. | |
| # Never ever ever use these in production or anything approximating | |
| # production. |
| According to my records your subscription will expire on 14 June 2014 | |
| LostCousins subscriptions are NOT renewed automatically unlike subscriptions for most other | |
| genealogy sites - I prefer to depend on your generosity, not your forgetfulness. | |
| The good news is that if you renew your subscription NOW it won't start until your existing | |
| subscription expires - you'll get a full 12 months from the date shown above (so you don't have | |
| to leave it until the last minute). Even better news is that the price hasn't changed since 2005 - | |
| it's still just 10 pounds for a single subscription! |
ruby 2.0.0p195 (2013-05-14 revision 40734) [x86_64-darwin12.4.0]
------------------------------------------------------------------------
1000 Iterations
Rehearsal --------------------------------------------------------
compiled haml pretty 0.550000 0.000000 0.550000 ( 0.551526)
compiled haml ugly 0.270000 0.000000 0.270000 ( 0.270457)
FriendlyId uses Rails's extending method to avoid overwriting your model's find method. Internally this is implemented similar to this:
def self.friendly
all.extending(friendly_id_config.finder_methods)
endThis however comes with a performance impact, because extending invokes Ruby's extend, which blows away MRI's method cache. To work around this, FriendlyId lets you include a :finders module which overrides your model's find to increase performance.
| module FlexMinder | |
| module Factories | |
| def factory(klass, attributes) | |
| name = klass.to_s | |
| underscored = name.underscore | |
| class_eval(<<-END, __FILE__, __LINE__ + 1) | |
| def build_#{underscored}(attributes = {}) | |
| attributes = valid_#{underscored}_attributes.deep_merge(attributes) | |
| #{name}.new(attributes) |