Skip to content

Instantly share code, notes, and snippets.

@odigity
Created October 5, 2015 21:49
Show Gist options
  • Select an option

  • Save odigity/18b8abdfb3641295a5cc to your computer and use it in GitHub Desktop.

Select an option

Save odigity/18b8abdfb3641295a5cc to your computer and use it in GitHub Desktop.
irb(main):010:0> Sequel::Model.instance_eval do
irb(main):011:1* def fixture_key
irb(main):012:2> singularize(underscore(demodulize(name))).to_sym
irb(main):013:2> end
irb(main):014:1> end
=> :fixture_key
irb(main):015:0> Sequel::Model.fixture_key
=> :model
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment