nakajima-fixjour 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -48,7 +48,7 @@ module Fixjour
48
48
  private
49
49
 
50
50
  def name_for(klass)
51
- klass.model_name.singular
51
+ klass.name.underscore
52
52
  end
53
53
 
54
54
  # Defines the new_* method
@@ -5,10 +5,6 @@ module Fixjour
5
5
  # Raised when a builder returns an object of the wrong type
6
6
  class WrongBuilderType < StandardError; end
7
7
 
8
- # Raised when a builder is defined for a class that already
9
- # has one.
10
- class RedundantBuilder < StandardError; end
11
-
12
8
  # Raised when a builder block saves the object.
13
9
  class BuilderSavedRecord < StandardError; end
14
10
 
@@ -10,7 +10,7 @@ module Fixjour
10
10
  result = evaluator.send("new_#{name_for(klass)}")
11
11
 
12
12
  unless result.valid?
13
- raise InvalidBuilder.new("The builder for #{klass} returns an invalid object")
13
+ raise InvalidBuilder.new("The builder for #{klass} returns an invalid object: #{result.errors.inspect}")
14
14
  end
15
15
 
16
16
  unless result.new_record?
data/lib/fixjour.rb CHANGED
@@ -3,6 +3,7 @@ $LOAD_PATH << File.dirname(__FILE__)
3
3
  require 'rubygems'
4
4
  require 'activerecord'
5
5
  require 'core_ext/hash'
6
+ require 'fixjour/redundant_check'
6
7
  require 'fixjour/verify'
7
8
  require 'fixjour/errors'
8
9
  require 'fixjour/builders'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nakajima-fixjour
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pat Nakajima