gravtastic 1.7.0 → 1.7.1
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/Rakefile +1 -1
- data/lib/gravtastic.rb +2 -2
- data/spec/gravtastic_spec.rb +5 -0
- metadata +1 -1
data/Rakefile
CHANGED
data/lib/gravtastic.rb
CHANGED
@@ -59,8 +59,8 @@ module Gravtastic
|
|
59
59
|
#
|
60
60
|
# has_gravatar :defaults => { :rating => 'R18' }
|
61
61
|
#
|
62
|
-
def has_gravatar(options={
|
63
|
-
@gravatar_source = options[:on]
|
62
|
+
def has_gravatar(options={})
|
63
|
+
@gravatar_source = options[:on] || :email
|
64
64
|
options[:defaults] ||= {}
|
65
65
|
@gravatar_defaults = {:rating => 'PG', :secure => false}.merge(options[:defaults])
|
66
66
|
end
|
data/spec/gravtastic_spec.rb
CHANGED
@@ -46,6 +46,11 @@ describe "Gravtastic::Model" do
|
|
46
46
|
@klass.gravatar_defaults.should == { :rating => 'PG', :secure => false }
|
47
47
|
end
|
48
48
|
|
49
|
+
it "sets .gravatar_source to :email by default, even when :defaults are supplied" do
|
50
|
+
@klass.has_gravatar :defaults => { :secure => true }
|
51
|
+
@klass.gravatar_source.should == :email
|
52
|
+
end
|
53
|
+
|
49
54
|
it "keeps either :rating or :secure if only the other is passed as a default" do
|
50
55
|
@klass.has_gravatar :defaults => { :secure => true }
|
51
56
|
@klass.gravatar_defaults.should == { :rating => 'PG', :secure => true }
|