attr_default 0.5.4 → 0.5.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,3 @@
1
1
  module AttrDefault
2
- VERSION = "0.5.4"
2
+ VERSION = "0.5.6"
3
3
  end
data/lib/attr_default.rb CHANGED
@@ -38,7 +38,7 @@ module AttrDefault
38
38
  end
39
39
 
40
40
  def _attr_defaults
41
- @_attr_defaults ||= (ancestors[1]._attr_defaults.dup rescue nil) || {}
41
+ @_attr_defaults ||= (superclass._attr_defaults.dup rescue nil) || {}
42
42
  end
43
43
  end
44
44
 
@@ -45,6 +45,10 @@ if defined?(Rails::Railtie)
45
45
  AttrDefault.initialize_active_record_extensions
46
46
  end
47
47
 
48
+ module SomeOtherModule
49
+
50
+ end
51
+
48
52
  class TestUser < ActiveRecord::Base
49
53
  attr_accessor :password
50
54
  attr_default :password, '<none>'
@@ -82,6 +86,7 @@ class TestDomain < ActiveRecord::Base
82
86
  end
83
87
 
84
88
  class TestDomainSubclass < TestDomain
89
+ include SomeOtherModule
85
90
  if ENV['INCLUDE_HOBO']
86
91
  fields do
87
92
  domain :string, :default => lambda { "sub_#{test_user.domain}" }
metadata CHANGED
@@ -1,13 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: attr_default
3
3
  version: !ruby/object:Gem::Version
4
- hash: 3
5
- prerelease:
4
+ prerelease: false
6
5
  segments:
7
6
  - 0
8
7
  - 5
9
- - 4
10
- version: 0.5.4
8
+ - 6
9
+ version: 0.5.6
11
10
  platform: ruby
12
11
  authors:
13
12
  - Colin Kelley
@@ -16,85 +15,76 @@ autorequire:
16
15
  bindir: bin
17
16
  cert_chain: []
18
17
 
19
- date: 2013-01-06 00:00:00 Z
18
+ date: 2013-02-26 00:00:00 -08:00
19
+ default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
22
- requirement: &id001 !ruby/object:Gem::Requirement
23
- none: false
22
+ type: :development
23
+ version_requirements: &id001 !ruby/object:Gem::Requirement
24
24
  requirements:
25
25
  - - ~>
26
26
  - !ruby/object:Gem::Version
27
- hash: 19
28
27
  segments:
29
28
  - 1
30
29
  - 1
31
30
  - 0
32
31
  version: 1.1.0
33
- prerelease: false
34
- type: :development
35
32
  name: rack
36
- version_requirements: *id001
33
+ requirement: *id001
34
+ prerelease: false
37
35
  - !ruby/object:Gem::Dependency
38
- requirement: &id002 !ruby/object:Gem::Requirement
39
- none: false
36
+ type: :development
37
+ version_requirements: &id002 !ruby/object:Gem::Requirement
40
38
  requirements:
41
39
  - - ~>
42
40
  - !ruby/object:Gem::Version
43
- hash: 25
44
41
  segments:
45
42
  - 0
46
43
  - 9
47
44
  version: "0.9"
48
- prerelease: false
49
- type: :development
50
45
  name: rake
51
- version_requirements: *id002
46
+ requirement: *id002
47
+ prerelease: false
52
48
  - !ruby/object:Gem::Dependency
53
- requirement: &id003 !ruby/object:Gem::Requirement
54
- none: false
49
+ type: :development
50
+ version_requirements: &id003 !ruby/object:Gem::Requirement
55
51
  requirements:
56
52
  - - "="
57
53
  - !ruby/object:Gem::Version
58
- hash: 31
59
54
  segments:
60
55
  - 2
61
56
  - 3
62
57
  - 14
63
58
  version: 2.3.14
64
- prerelease: false
65
- type: :development
66
59
  name: rails
67
- version_requirements: *id003
60
+ requirement: *id003
61
+ prerelease: false
68
62
  - !ruby/object:Gem::Dependency
69
- requirement: &id004 !ruby/object:Gem::Requirement
70
- none: false
63
+ type: :development
64
+ version_requirements: &id004 !ruby/object:Gem::Requirement
71
65
  requirements:
72
66
  - - ">="
73
67
  - !ruby/object:Gem::Version
74
- hash: 3
75
68
  segments:
76
69
  - 0
77
70
  version: "0"
78
- prerelease: false
79
- type: :development
80
71
  name: sqlite3
81
- version_requirements: *id004
72
+ requirement: *id004
73
+ prerelease: false
82
74
  - !ruby/object:Gem::Dependency
83
- requirement: &id005 !ruby/object:Gem::Requirement
84
- none: false
75
+ type: :development
76
+ version_requirements: &id005 !ruby/object:Gem::Requirement
85
77
  requirements:
86
78
  - - "="
87
79
  - !ruby/object:Gem::Version
88
- hash: 245
89
80
  segments:
90
81
  - 0
91
82
  - 9
92
83
  - 103
93
84
  version: 0.9.103
94
- prerelease: false
95
- type: :development
96
85
  name: hobofields
97
- version_requirements: *id005
86
+ requirement: *id005
87
+ prerelease: false
98
88
  description: Dynamic Ruby defaults for ActiveRecord attributes
99
89
  email:
100
90
  - colindkelley@gmail.com
@@ -115,6 +105,7 @@ files:
115
105
  - lib/attr_default/railtie.rb
116
106
  - lib/attr_default/version.rb
117
107
  - test/test_attr_default.rb
108
+ has_rdoc: true
118
109
  homepage: https://github.com/RingRevenue/attr_default
119
110
  licenses: []
120
111
 
@@ -124,27 +115,23 @@ rdoc_options: []
124
115
  require_paths:
125
116
  - lib
126
117
  required_ruby_version: !ruby/object:Gem::Requirement
127
- none: false
128
118
  requirements:
129
119
  - - ">="
130
120
  - !ruby/object:Gem::Version
131
- hash: 3
132
121
  segments:
133
122
  - 0
134
123
  version: "0"
135
124
  required_rubygems_version: !ruby/object:Gem::Requirement
136
- none: false
137
125
  requirements:
138
126
  - - ">="
139
127
  - !ruby/object:Gem::Version
140
- hash: 3
141
128
  segments:
142
129
  - 0
143
130
  version: "0"
144
131
  requirements: []
145
132
 
146
133
  rubyforge_project:
147
- rubygems_version: 1.8.24
134
+ rubygems_version: 1.3.6
148
135
  signing_key:
149
136
  specification_version: 3
150
137
  summary: "Dynamic Ruby defaults for ActiveRecord attributes. These are lazy evaluated just in time: when first accessed, or just before validation or save. This allows dynamic defaults to depend on attributes that are assigned after initialization, or on other dynamic defaults."