accessitude 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- accessitude (0.0.1)
4
+ accessitude (0.0.2)
5
5
  activerecord (> 3.0.0)
6
6
 
7
7
  GEM
data/lib/accessitude.rb CHANGED
@@ -24,7 +24,12 @@ module Accessitude
24
24
  define_method :accessitude_attrs do
25
25
  self.class.accessitude_attrs
26
26
  end
27
-
27
+
28
+ # Check if any of the accessible attributes are not _blank_
29
+ # @return [Boolean]
30
+ define_method :has_accessitude_data do
31
+ self.attributes.values_at( *self.accessitude_attrs ).compact.delete_if { |attr| attr.blank? }.size > 0
32
+ end
28
33
 
29
34
  # Set attributes of instance only using attr_accessible params
30
35
  define_method :attributes_from_params do |params|
@@ -14,5 +14,5 @@
14
14
  # the License.
15
15
 
16
16
  module Accessitude
17
- VERSION = "0.0.1"
17
+ VERSION = "0.0.2"
18
18
  end
@@ -47,6 +47,11 @@ describe Accessitude do
47
47
  subject.body.should eql "test body"
48
48
  subject.hamster.should eql "hamster"
49
49
  end
50
+
51
+ it "should have accessitude data" do
52
+ Message.new.has_accessitude_data.should be_false
53
+ subject.has_accessitude_data.should be_true
54
+ end
50
55
  end
51
56
 
52
57
  describe "New" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: accessitude
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -115,7 +115,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
115
115
  version: '0'
116
116
  requirements: []
117
117
  rubyforge_project:
118
- rubygems_version: 1.8.25
118
+ rubygems_version: 1.8.23
119
119
  signing_key:
120
120
  specification_version: 3
121
121
  summary: Accessitude