is_graffitiable 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/VERSION.yml +1 -1
  2. data/lib/is_graffitiable.rb +4 -1
  3. metadata +3 -3
@@ -1,4 +1,4 @@
1
1
  ---
2
2
  :minor: 1
3
- :patch: 2
3
+ :patch: 3
4
4
  :major: 0
@@ -52,7 +52,10 @@ module IsGraffitiable
52
52
  return true unless @graffiti_map
53
53
 
54
54
  @new_graffitis.each do |graffiti|
55
- unless graffiti.valid?
55
+ # ideally we want to use graffiti.valid? method. However, at this point,
56
+ # graffitiable_id and graffitiable_type hasn't been set yet. So we'll just have to do
57
+ # our own validation here
58
+ if graffiti.name.empty? or graffiti.value.empty?
56
59
  errors.add("Graffiti", "is invalid")
57
60
  return false
58
61
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: is_graffitiable
3
3
  version: !ruby/object:Gem::Version
4
- hash: 31
4
+ hash: 29
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 2
10
- version: 0.1.2
9
+ - 3
10
+ version: 0.1.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Darren Dao