tasuku 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0b0e37a9ae098ec1c1933a0d5d69d517a1ee9397
4
- data.tar.gz: fab33f963e6b44883daa2d15b41ea90e9d4958d7
3
+ metadata.gz: 91fd68be24466c75a16e67d93379f4005e00abf0
4
+ data.tar.gz: ce7bcd6b85315d1816ddbf646983224bd4b17c4e
5
5
  SHA512:
6
- metadata.gz: d91280373ec8d16e6635a5bb647a4e931eb8ece9c5838cd0831dbb70ea5400d1ad53cb77f5095c291feec0151e7c479e7e61358ac53030f7364bf6f7af72b50e
7
- data.tar.gz: 9b68f94763ad774632bf700b1b8c701e21929145fa2f6835584c3771621130bb224a4790c140efda6895339fd80db33a569f1b49b66611e078770271a1b93130
6
+ metadata.gz: bb8da418ba435900c235a11d654bfc0aa3b0787504981e68bb8fa386dbe6e17e013743c0562c6fceb8fa96e1e3a1f2ef76625e1301f8cd9f5ed03ec5a5c87b1e
7
+ data.tar.gz: 36ef622a0fb7890134e99def5df38b6e89a16da851b5d6bca744baf6ac1b03ef9590ce0cb79b90a895b41fd477a2218b05094f769ffaa57bbd1a9571f2a52faf
@@ -3,5 +3,7 @@ module Tasuku
3
3
  belongs_to :question
4
4
  has_many :votes
5
5
  has_many :answers, through: :votes
6
+
7
+ validates_presence_of :text
6
8
  end
7
9
  end
@@ -1,3 +1,5 @@
1
+ # This migration is deficient in that it doesn't send `each` on line 5 and so does nothing,
2
+ # but since it has already been run we have to keep it around.
1
3
  class MigrateExistingDate < ActiveRecord::Migration
2
4
  def up
3
5
  %w(Image::Response Question::Answer Text::Response URL::Response).each do |class_name|
@@ -0,0 +1,19 @@
1
+ class MigrateResponses < ActiveRecord::Migration
2
+ def up
3
+ %w(Image::Response Question::Answer Text::Response URL::Response Verification::Confirmation).each do |class_name|
4
+ "Tasuku::Taskables::#{class_name}".constantize.all.each do |model|
5
+ if model.request.task.present?
6
+ Tasuku::Taskables::Taskable::Response.create! do |response|
7
+ response.author = model.author
8
+ response.submittable = model
9
+ response.task = model.request.task
10
+ end
11
+ end
12
+ end
13
+ end
14
+ end
15
+
16
+ def down
17
+ Tasuku::Taskables::Taskable::Response.destroy_all
18
+ end
19
+ end
@@ -8,6 +8,8 @@ module Tasuku
8
8
 
9
9
  has_many :responses
10
10
 
11
+ validates_presence_of :text
12
+
11
13
  responses are: :responses
12
14
 
13
15
  def to_s
@@ -9,6 +9,8 @@ module Tasuku
9
9
  has_many :options
10
10
  has_many :votes, through: :options
11
11
 
12
+ validates_presence_of :text
13
+
12
14
  accepts_nested_attributes_for :options, allow_destroy: true
13
15
 
14
16
  def answers
@@ -8,6 +8,8 @@ module Tasuku
8
8
 
9
9
  has_many :responses, dependent: :destroy
10
10
 
11
+ validates_presence_of :text
12
+
11
13
  responses are: :responses
12
14
 
13
15
  def to_s
@@ -8,6 +8,8 @@ module Tasuku
8
8
 
9
9
  has_many :responses, dependent: :destroy
10
10
 
11
+ validates_presence_of :text
12
+
11
13
  responses are: :responses
12
14
 
13
15
  def to_s
@@ -1,3 +1,3 @@
1
1
  module Tasuku
2
- VERSION = '0.1.0'
2
+ VERSION = '0.1.1'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tasuku
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Johannes Gorset
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-06-10 00:00:00.000000000 Z
11
+ date: 2014-06-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -267,6 +267,7 @@ files:
267
267
  - db/migrate/20140606072225_migrate_existing_date.rb
268
268
  - db/migrate/20140606112652_migrate_polymorphic_relations.rb
269
269
  - db/migrate/20140610121130_change_tasks_tables_to_tasuku_tables.rb
270
+ - db/migrate/20140613115558_migrate_responses.rb
270
271
  - lib/generators/tasuku/install/USAGE
271
272
  - lib/generators/tasuku/install/install_generator.rb
272
273
  - lib/generators/tasuku/install/templates/tasuku.rb