Skip to content

Instantly share code, notes, and snippets.

@wycats
Created August 14, 2008 01:40
Show Gist options
  • Save wycats/5346 to your computer and use it in GitHub Desktop.
Save wycats/5346 to your computer and use it in GitHub Desktop.
>> module DataMapper; class Collection; alias_method :create_or_error, :create; end; end
=> DataMapper::Collection
>> Customer.first.environments.create_or_error
=> #<Environment created_at=nil updated_at=nil id=nil number=nil classification=nil description=nil cluster_id=nil customer_id=1>
>> module DataMapper; class Collection; alias_method :create_or_error, :create; end; end
=> DataMapper::Collection
>> Customer.first.environments.create_or_error
=> #<Environment created_at=nil updated_at=nil id=nil number=nil classification=nil description=nil cluster_id=nil customer_id=nil>
>> Customer.first.environments.create
=> #<Environment created_at=nil updated_at=nil id=nil number=nil classification=nil description=nil cluster_id=nil customer_id=1>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment