This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/lib/dm-core/resource.rb b/lib/dm-core/resource.rb | |
index 225200d..8eb59bf 100644 | |
--- a/lib/dm-core/resource.rb | |
+++ b/lib/dm-core/resource.rb | |
@@ -40,6 +40,10 @@ module DataMapper | |
model.const_set('Resource', self) unless model.const_defined?('Resource') | |
extra_inclusions.each { |inclusion| model.send(:include, inclusion) } | |
descendants << model | |
+ class << model | |
+ @_valid_model = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Before Yehuda's commit ( e253765ed82aa91cc91555eb5871d82d5df3e436 ): | |
| DM 0.9.4 | AR 2.1 | DIFF | | |
-------------------------------------------------------------------------------- | |
Model.new (instantiation) x10000 | 0.949 | 0.568 | 1.67x | | |
Model.new(setting attributes) x10000 | 2.757 | 2.233 | 1.23x | | |
Before _monki's fix ( db6c116af073ad5cd219652366f2ef4fb47ef807 ): | |
| DM 0.9.4 | AR 2.1 | DIFF | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
:_type => Template, | |
:id => template.path, | |
:href => uri(:controller => :templates, :action => template.path), | |
:name => template.name, | |
:description => template.description, | |
:max_associations_per_configuration => template.max_associations_per_configuration, | |
:questions_href => questions_url(template), | |
:restricted_platforms => template.restricted_platforms, | |
:restricted_clients => template.restricted_clients |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"href": "http://config.ssbe.localhost/templates", | |
"item_count": 1, | |
"items": [ | |
{ | |
"id": "os/linux/linux-core", | |
"href": "http://config.ssbe.localhost/templates/os/linux/linux-core", | |
"name": "Linux Core", | |
"description": "CPU and other general Linux metrics", | |
"max-associations-per-configuration": 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe 'creating a article by web services' do | |
before do | |
@result = post('/articles', '{ "title": "My Article", "text": "Lorem Ipsum" }', :content_type => 'application/json') | |
@article_uri = @result.header['Location'] | |
id = parse_route(@article_uri)[:id] | |
@article = Article.get(id) | |
end | |
it 'should be successful' do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'uuidtools' | |
module DataMapper | |
module Types | |
class UUID < DataMapper::Type | |
default lambda { ::UUID.random_create } | |
def self.load(value, property) | |
puts value.inspect |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'dm-sweatshop' | |
require 'uuidtools' | |
Configuration.fixture {{ | |
:uuid => UUID.random_create, | |
:name => /\w+/.gen[1..4], | |
:client_href => ("http://core.ssbe.localhost/clients/" + /\w+/.gen), | |
:notes => /[:sentence:]/.gen[0..140], | |
:platform => /\w+/.gen, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Answers < Application | |
provides :sscj1 | |
... | |
def show | |
raise "Oh noes!" | |
@answer = answer | |