cia 0.5.0 → 0.5.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cia (0.5.0)
4
+ cia (0.5.1)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -5,6 +5,7 @@ create_table :cia_events do |t|
5
5
  t.integer :source_id, :null => false
6
6
  t.string :ip_address
7
7
  t.string :message
8
+ t.string :source_display_name
8
9
  t.timestamp :created_at#, :null => false
9
10
  end
10
11
 
@@ -36,7 +36,7 @@ module CIA
36
36
  private
37
37
 
38
38
  def source_must_be_exist?
39
- new_record? and action != "destroy"
39
+ new_record? and action != "destroy" and (!attributes.key?("source_display_name") or source_display_name.blank?)
40
40
  end
41
41
  end
42
42
  end
@@ -1,3 +1,3 @@
1
1
  module CIA
2
- VERSION = '0.5.0'
2
+ VERSION = '0.5.1'
3
3
  end
@@ -41,5 +41,15 @@ describe CIA::Event do
41
41
  it "does not validates source when updating" do
42
42
  create_event.update_attributes!(:source_id => 9999)
43
43
  end
44
+
45
+ it "does not validates source when source_display_name is present" do
46
+ create_event(:source_id => -111, :source_type => 'FakeTypeHere', :source_display_name => 'abc')
47
+ end
48
+
49
+ it "validates source when source_display_name is blank" do
50
+ expect{
51
+ create_event(:source_id => -111, :source_type => 'FakeTypeHere', :source_display_name => '')
52
+ }.to raise_error
53
+ end
44
54
  end
45
55
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cia
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-03-19 00:00:00.000000000 Z
12
+ date: 2013-04-03 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description:
15
15
  email: michael@grosser.it
@@ -53,7 +53,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
53
53
  version: '0'
54
54
  segments:
55
55
  - 0
56
- hash: 1430160923032758122
56
+ hash: 763715577879063056
57
57
  required_rubygems_version: !ruby/object:Gem::Requirement
58
58
  none: false
59
59
  requirements:
@@ -62,7 +62,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
62
62
  version: '0'
63
63
  segments:
64
64
  - 0
65
- hash: 1430160923032758122
65
+ hash: 763715577879063056
66
66
  requirements: []
67
67
  rubyforge_project:
68
68
  rubygems_version: 1.8.25