ploymorphic_wuid 0.4.1 → 0.4.2

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.
data/README.rdoc CHANGED
@@ -47,9 +47,6 @@ end
47
47
 
48
48
  obj.wid
49
49
 
50
- == advantage
51
-
52
- acts_as_wuid :acts_as_tree => true
53
50
 
54
51
  == Note on Patches/Pull Requests
55
52
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.4.1
1
+ 0.4.2
@@ -7,8 +7,10 @@ module PloymorphicModule
7
7
  module ClassMethods
8
8
 
9
9
  def acts_as_wuid options={}
10
- has_one :wuid, :as => :wuidable, :dependent => :destroy
11
- include PloymorphicModule::InstanceMethods
10
+ default_options = { :as => :wuidable, :dependent => :destroy }
11
+ default_options.merge!(options) unless options.empty?
12
+ has_one :wuid, default_options
13
+ PloymorphicModule::InstanceMethods
12
14
  end
13
15
 
14
16
  end
@@ -16,7 +18,7 @@ module PloymorphicModule
16
18
  module InstanceMethods
17
19
 
18
20
  def wid
19
- self.wuid.id
21
+ self.wuid.id rescue nil
20
22
  end
21
23
 
22
24
  def after_create
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{ploymorphic_wuid}
8
- s.version = "0.4.1"
8
+ s.version = "0.4.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["tim.teng"]
12
- s.date = %q{2010-03-31}
12
+ s.date = %q{2010-04-28}
13
13
  s.description = %q{ This is a gem to generate an unique id in your application world.}
14
14
  s.email = %q{tim.rubist@gmail.com}
15
15
  s.extra_rdoc_files = [
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 4
8
- - 1
9
- version: 0.4.1
8
+ - 2
9
+ version: 0.4.2
10
10
  platform: ruby
11
11
  authors:
12
12
  - tim.teng
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-03-31 00:00:00 +08:00
17
+ date: 2010-04-28 00:00:00 +08:00
18
18
  default_executable:
19
19
  dependencies: []
20
20