modelfactory 0.8.0 → 0.8.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,7 @@
1
+ == 0.8.1 2009-05-08
2
+
3
+ * Ruby 1.9.1 compatibility
4
+
1
5
  == 0.8.0 2008-12-10
2
6
 
3
7
  * added the ability to specify multiple named types of defaults
@@ -13,9 +13,9 @@ module ModelFactory
13
13
  # object as a dependency use the special method default_* instead of
14
14
  # create_* or new_*.
15
15
  #
16
- def default(class_type, *args)
17
- defaults = args.pop || {}
18
- prefix = args.first
16
+ def default(class_type, *default_args)
17
+ defaults = default_args.pop || {}
18
+ prefix = default_args.first
19
19
  class_name = class_type.name.demodulize.underscore
20
20
  class_name = "#{prefix}_#{class_name}" if prefix
21
21
 
@@ -57,8 +57,8 @@ module ModelFactory
57
57
  def default_closure(class_type, attributes, defaults = {}) # :nodoc:
58
58
  lambda do |create_or_new|
59
59
  case create_or_new
60
- when :new : new_instance(class_type, attributes, defaults)
61
- when :create : create_instance(class_type, attributes, defaults)
60
+ when :new ; new_instance(class_type, attributes, defaults)
61
+ when :create ; create_instance(class_type, attributes, defaults)
62
62
  end
63
63
  end
64
64
  end
@@ -82,7 +82,7 @@ module ModelFactory
82
82
  if protected_attrs or accessible_attrs
83
83
  attributes.each do |key, value|
84
84
  # Support symbols and strings.
85
- next if protected_attrs and not (protected_attrs.include?(key) or protected_attrs.include?(key.to_s))
85
+ next if protected_attrs and (not protected_attrs.include?(key) or protected_attrs.include?(key.to_s))
86
86
  next if accessible_attrs and (accessible_attrs.include?(key) or accessible_attrs.include?(key.to_s))
87
87
  modified = true
88
88
  instance.send("#{key}=", value)
@@ -2,7 +2,7 @@ module ModelFactory #:nodoc:
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 0
4
4
  MINOR = 8
5
- TINY = 0
5
+ TINY = 1
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: modelfactory
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 0.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Balthrop
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2008-12-10 00:00:00 -08:00
13
+ date: 2009-05-08 00:00:00 -07:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
@@ -21,7 +21,7 @@ dependencies:
21
21
  requirements:
22
22
  - - ">="
23
23
  - !ruby/object:Gem::Version
24
- version: 1.8.2
24
+ version: 1.12.2
25
25
  version:
26
26
  description: A replacement for fixtures.
27
27
  email: justin@geni.com