refinerycms-applicants 1.0.0 → 1.0.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 823e1cee1bb696cd2021a8cc8bd3a6e72702255f
4
- data.tar.gz: 3bc73fd3a86a75f71569e5f26f44162fad47d7a2
3
+ metadata.gz: 17e694c2ed0072afcb96a138400c8c7cf23f864c
4
+ data.tar.gz: a99913659a772f5001ceae31fa509fd80c2de408
5
5
  SHA512:
6
- metadata.gz: 2ac9e15af155042f0c1ce466d39fd0031f033347ca07084836d2796269d5c5eb8dcc710ecab44edd9b919a699b006f48452d54519c6d10364fc936360d6dd893
7
- data.tar.gz: 8a67c8a04221311dc0844a9e620426f68493c94351c34b383f2c4c6ee0f1e73b0021e3ce8aaf7f303011bbf23fa75c2c43d35cceb725af3d15464ce92d3d57ef
6
+ metadata.gz: 86aa572516c20d2c908812c8a664ae153df84c79c0daead137241a64796b55db9aa65ca9413f0bbc2ccde2d1435da54b1ab20c76c2b8da8dc9a2355e6280a615
7
+ data.tar.gz: 6b46095fad0d6ce29dc22408e4bbbff0ce990dfb8a36532bdda9094de82f1f9097be696c4350ae76184b9831c51b9262d8792633886cc01198152d7023d9d77d
@@ -2,7 +2,8 @@ module Admin
2
2
  class QuestionsController < Admin::BaseController
3
3
 
4
4
  crudify :question,
5
- :title_attribute => 'name'
5
+ :title_attribute => 'name',
6
+ :conditions => 'deleted_at IS NULL'
6
7
 
7
8
  def index
8
9
  search_all_questions if searching?
@@ -13,7 +13,7 @@ class Applicant < ActiveRecord::Base
13
13
  validates :contact_phone, :presence => true
14
14
 
15
15
  def build_answers
16
- Question.all.each do |q|
16
+ Question.current.all.each do |q|
17
17
  answers.build(:question => q)
18
18
  end
19
19
 
@@ -9,6 +9,8 @@ class Question < ActiveRecord::Base
9
9
  has_many :answers, :foreign_key => :applicant_question_id
10
10
  has_many :applicants, :through => :answers
11
11
 
12
+ scope :current, where('deleted_at IS NULL')
13
+
12
14
  validates :name, :presence => true, :uniqueness => true
13
15
  validates :answer_type, :presence => true, :inclusion => ANSWER_TYPES
14
16
 
@@ -18,6 +20,11 @@ class Question < ActiveRecord::Base
18
20
  character_limit && character_limit > 0
19
21
  end
20
22
 
23
+ # override for 'safe delete'
24
+ def destroy
25
+ update_attribute(:deleted_at, Time.now)
26
+ end
27
+
21
28
  private
22
29
 
23
30
  def set_defaults
@@ -1,5 +1,5 @@
1
1
  module Refinery
2
2
  module Applicants
3
- VERSION = '1.0.0'
3
+ VERSION = '1.0.1'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: refinerycms-applicants
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nick Plante
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-09-07 00:00:00.000000000 Z
11
+ date: 2013-09-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: refinerycms