has_defaults 0.4.1 → 0.4.2
Sign up to get free protection for your applications and to get access to all the features.
- data/has_defaults.gemspec +1 -0
- data/lib/has_defaults/active_record_ext.rb +1 -1
- data/lib/has_defaults/version.rb +1 -1
- data/spec/rails-2.3/Gemfile.lock +1 -1
- data/spec/rails-3.0/Gemfile.lock +1 -1
- data/spec/rails-3.2/Gemfile.lock +1 -1
- data/spec/shared/app_root/app/models/donut.rb +3 -3
- metadata +6 -6
data/has_defaults.gemspec
CHANGED
@@ -5,6 +5,7 @@ Gem::Specification.new do |s|
|
|
5
5
|
s.name = 'has_defaults'
|
6
6
|
s.version = HasDefaults::VERSION
|
7
7
|
s.authors = ["Henning Koch"]
|
8
|
+
s.licenses = ["MIT"]
|
8
9
|
s.email = 'henning.koch@makandra.de'
|
9
10
|
s.homepage = 'https://github.com/makandra/has_defaults'
|
10
11
|
s.summary = 'Default values for ActiveRecord models.'
|
data/lib/has_defaults/version.rb
CHANGED
data/spec/rails-2.3/Gemfile.lock
CHANGED
data/spec/rails-3.0/Gemfile.lock
CHANGED
data/spec/rails-3.2/Gemfile.lock
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
class Donut < Pastry
|
2
2
|
|
3
3
|
has_defaults :flavor => "cream", :name => "Cream"
|
4
|
-
has_defaults :maker =>
|
5
|
-
has_defaults :weight =>
|
6
|
-
has_defaults :health_benefits =>
|
4
|
+
has_defaults :maker => lambda { "Dunkin Donuts" }
|
5
|
+
has_defaults :weight => lambda { weigh }
|
6
|
+
has_defaults :health_benefits => lambda { self.class.global_health_benefits }
|
7
7
|
|
8
8
|
def flavor
|
9
9
|
@flavor_getter_called = true
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: has_defaults
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 11
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 4
|
9
|
-
-
|
10
|
-
version: 0.4.
|
9
|
+
- 2
|
10
|
+
version: 0.4.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Henning Koch
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date:
|
18
|
+
date: 2015-05-08 00:00:00 +02:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -119,8 +119,8 @@ files:
|
|
119
119
|
- spec/shared/has_defaults/active_record_ext_spec.rb
|
120
120
|
has_rdoc: true
|
121
121
|
homepage: https://github.com/makandra/has_defaults
|
122
|
-
licenses:
|
123
|
-
|
122
|
+
licenses:
|
123
|
+
- MIT
|
124
124
|
post_install_message:
|
125
125
|
rdoc_options: []
|
126
126
|
|