I hereby claim:
- I am d3r1v3d on github.
- I am d3r1v3d (https://keybase.io/d3r1v3d) on keybase.
- I have a public key ASDErgTstlmf6_akJPatkjJzbMrjVK4u4kuglXM-ehgS3go
To claim this, I am signing this object:
/** | |
* Examples of writing mixed unit/property-based (ScalaCheck) tests. | |
* | |
* Includes tables and generators as well as 'traditional' tests. | |
* | |
* @see http://www.scalatest.org/user_guide/selecting_a_style | |
* @see http://www.scalatest.org/user_guide/property_based_testing | |
*/ | |
import org.scalatest._ |
I hereby claim:
To claim this, I am signing this object:
module CustomColumnTypes | |
def double(*args) | |
args.last[:limit] = 53 if args.last.is_a? Hash | |
float *args | |
end | |
end | |
module ActiveRecord | |
module ConnectionAdapters | |
class Table |
class CarsController < ApplicationController | |
# ... | |
# GET /cars/1 | |
def show | |
@car = Car.find(params[:id]) | |
# ... | |
end | |
# GET /cars/1/edit |
module EnumSupport | |
def enum(name, values) | |
const_name = name.to_s.pluralize.upcase | |
self.class_eval " | |
#{const_name} = %w{#{values.join(' ')}}.map{ |val| val.to_sym } | |
validates :#{name}, :presence => true, | |
:inclusion => {:in => #{const_name}, :message => self.bad_enum_message(#{const_name})} | |
def #{name} | |
read_attribute(:#{name}).to_sym | |
end |