osm 1.2.18 → 1.2.19

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/CHANGELOG.md +4 -0
  2. data/lib/osm/member.rb +7 -5
  3. data/version.rb +1 -1
  4. metadata +1 -1
@@ -1,3 +1,7 @@
1
+ ## Version 1.2.19
2
+
3
+ * Fix validity checks for member in rails 3
4
+
1
5
  ## Version 1.2.18
2
6
 
3
7
  * Add gem version into the cache key
@@ -105,19 +105,21 @@ module Osm
105
105
  :contact, :primary_contact, :secondary_contact, :emergency_contact, :doctor
106
106
  end
107
107
 
108
+ unless ActiveModel::VERSION::MAJOR < 4
109
+ validates_presence_of :grouping_label, :allow_blank => true
110
+ validates_presence_of :grouping_leader_label, :allow_blank => true
111
+ validates_presence_of :additional_information, :allow_blank => true
112
+ validates_presence_of :additional_information_labels, :allow_blank => true
113
+ validates_presence_of :finished_section, :allow_nil=>true
114
+ end
108
115
  validates_numericality_of :id, :only_integer=>true, :greater_than=>0, :unless => Proc.new { |r| r.id.nil? }
109
116
  validates_numericality_of :section_id, :only_integer=>true, :greater_than=>0
110
117
  validates_numericality_of :grouping_id, :only_integer=>true, :greater_than_or_equal_to=>-2
111
118
  validates_numericality_of :grouping_leader, :only_integer=>true, :greater_than_or_equal_to=>0, :less_than_or_equal_to=>14, :allow_nil => true
112
119
  validates_presence_of :first_name
113
120
  validates_presence_of :last_name
114
- validates_presence_of :grouping_label, :allow_blank => true
115
- validates_presence_of :grouping_leader_label, :allow_blank => true
116
- validates_presence_of :additional_information, :allow_blank => true
117
- validates_presence_of :additional_information_labels, :allow_blank => true
118
121
  validates_presence_of :date_of_birth
119
122
  validates_presence_of :started_section
120
- validates_presence_of :finished_section, :allow_nil=>true
121
123
  validates_presence_of :joined_movement
122
124
  validates_format_of :age, :with => /\A[0-9]{1,3} \/ (?:0?[0-9]|1[012])\Z/, :message => 'age is not in the correct format (yy / mm)', :allow_blank => true
123
125
  validates_inclusion_of :gender, :in => [:male, :female, :other, :unspecified], :allow_nil => true
data/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Osm
2
- VERSION = "1.2.18"
2
+ VERSION = "1.2.19"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: osm
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.18
4
+ version: 1.2.19
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: