tasuku 0.0.1 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (164) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +6 -6
  3. data/app/assets/javascripts/{tasks → tasuku}/application.js +0 -0
  4. data/app/assets/stylesheets/{tasks → tasuku}/application.css +0 -0
  5. data/app/controllers/{tasks → tasuku}/application_controller.rb +1 -1
  6. data/app/controllers/{tasks → tasuku}/taskables/image/responses_controller.rb +2 -2
  7. data/app/controllers/{tasks → tasuku}/taskables/questions/answers_controller.rb +2 -2
  8. data/app/controllers/{tasks → tasuku}/taskables/text/responses_controller.rb +2 -2
  9. data/app/controllers/{tasks → tasuku}/taskables/url/responses_controller.rb +2 -2
  10. data/app/controllers/{tasks → tasuku}/taskables/verifications/confirmations_controller.rb +2 -2
  11. data/app/controllers/{tasks → tasuku}/tasks_controller.rb +2 -2
  12. data/app/helpers/{tasks → tasuku}/application_helper.rb +1 -1
  13. data/app/helpers/{tasks → tasuku}/taskables/verifications_helper.rb +2 -2
  14. data/app/models/{tasks → tasuku}/task.rb +1 -1
  15. data/app/models/{tasks → tasuku}/taskables.rb +2 -2
  16. data/app/models/{tasks → tasuku}/taskables/image.rb +2 -2
  17. data/app/models/{tasks → tasuku}/taskables/image/request.rb +1 -1
  18. data/app/models/{tasks → tasuku}/taskables/image/response.rb +1 -1
  19. data/app/models/{tasks → tasuku}/taskables/question.rb +1 -1
  20. data/app/models/{tasks → tasuku}/taskables/question/answer.rb +4 -8
  21. data/app/models/{tasks → tasuku}/taskables/question/option.rb +1 -1
  22. data/app/models/tasuku/taskables/question/vote.rb +6 -0
  23. data/app/models/{tasks → tasuku}/taskables/taskable.rb +2 -2
  24. data/app/models/{tasks → tasuku}/taskables/taskable/response.rb +2 -2
  25. data/app/models/{tasks → tasuku}/taskables/taskable/submission.rb +1 -1
  26. data/app/models/{tasks → tasuku}/taskables/text.rb +2 -2
  27. data/app/models/{tasks → tasuku}/taskables/text/request.rb +1 -1
  28. data/app/models/{tasks → tasuku}/taskables/text/response.rb +1 -1
  29. data/app/models/{tasks → tasuku}/taskables/url.rb +2 -2
  30. data/app/models/{tasks → tasuku}/taskables/url/request.rb +1 -1
  31. data/app/models/{tasks → tasuku}/taskables/url/response.rb +1 -1
  32. data/app/models/{tasks → tasuku}/taskables/verification.rb +2 -2
  33. data/app/models/{tasks → tasuku}/taskables/verification/confirmation.rb +1 -1
  34. data/app/uploaders/{tasks → tasuku}/image_uploader.rb +1 -1
  35. data/app/views/{tasks → tasuku}/taskables/image/requests/_request.html.erb +1 -1
  36. data/app/views/tasuku/taskables/image/responses/_form.html.erb +8 -0
  37. data/app/views/tasuku/taskables/image/responses/create.html.erb +2 -0
  38. data/app/views/{tasks → tasuku}/taskables/questions/_question.html.erb +3 -3
  39. data/app/views/{tasks → tasuku}/taskables/questions/answers/_form.html.erb +2 -2
  40. data/app/views/{tasks → tasuku}/taskables/questions/answers/_statistics.html.erb +0 -0
  41. data/app/views/{tasks → tasuku}/taskables/text/requests/_request.html.erb +2 -2
  42. data/app/views/tasuku/taskables/text/responses/_form.html.erb +5 -0
  43. data/app/views/tasuku/taskables/text/responses/create.html.erb +2 -0
  44. data/app/views/{tasks → tasuku}/taskables/url/requests/_request.html.erb +3 -3
  45. data/app/views/tasuku/taskables/url/responses/_form.html.erb +5 -0
  46. data/app/views/tasuku/taskables/url/responses/create.html.erb +2 -0
  47. data/app/views/{tasks → tasuku}/taskables/verifications/_verification.html.erb +0 -0
  48. data/app/views/tasuku/taskables/verifications/confirmations/_form.html.erb +3 -0
  49. data/app/views/{tasks → tasuku}/tasks/_task.html.erb +0 -0
  50. data/app/views/{tasks → tasuku}/tasks/show.html.erb +0 -0
  51. data/config/locales/en.yml +1 -1
  52. data/config/locales/nb.yml +24 -25
  53. data/config/routes.rb +1 -1
  54. data/db/migrate/20140512131526_remove_option_id_from_questions.rb +12 -4
  55. data/db/migrate/20140606112652_migrate_polymorphic_relations.rb +19 -0
  56. data/db/migrate/20140610121130_change_tasks_tables_to_tasuku_tables.rb +48 -0
  57. data/lib/generators/tasuku/install/USAGE +5 -0
  58. data/lib/generators/tasuku/install/install_generator.rb +23 -0
  59. data/lib/generators/{tasks/install/templates/tasks.rb → tasuku/install/templates/tasuku.rb} +1 -1
  60. data/lib/generators/{tasks → tasuku}/views/USAGE +1 -1
  61. data/lib/generators/{tasks → tasuku}/views/views_generator.rb +2 -2
  62. data/lib/tasuku.rb +21 -1
  63. data/lib/tasuku/concerns.rb +7 -0
  64. data/lib/tasuku/concerns/controllers.rb +5 -0
  65. data/lib/{tasks → tasuku}/concerns/controllers/tasks_controller.rb +1 -1
  66. data/lib/{tasks → tasuku}/concerns/illustratable.rb +1 -1
  67. data/lib/tasuku/concerns/models.rb +4 -0
  68. data/lib/{tasks → tasuku}/concerns/models/task.rb +4 -4
  69. data/lib/tasuku/concerns/models/taskables.rb +7 -0
  70. data/lib/tasuku/concerns/models/taskables/image.rb +3 -0
  71. data/lib/{tasks → tasuku}/concerns/models/taskables/image/request.rb +1 -1
  72. data/lib/{tasks → tasuku}/concerns/models/taskables/question.rb +1 -1
  73. data/lib/tasuku/concerns/models/taskables/text.rb +3 -0
  74. data/lib/{tasks → tasuku}/concerns/models/taskables/text/request.rb +1 -1
  75. data/lib/tasuku/concerns/models/taskables/url.rb +3 -0
  76. data/lib/{tasks → tasuku}/concerns/models/taskables/url/request.rb +1 -1
  77. data/lib/{tasks → tasuku}/concerns/models/taskables/verification.rb +1 -1
  78. data/lib/{tasks → tasuku}/concerns/redirectable.rb +1 -1
  79. data/lib/{tasks → tasuku}/concerns/verifiable.rb +2 -1
  80. data/lib/{tasks → tasuku}/engine.rb +5 -5
  81. data/lib/tasuku/seeds.rb +13 -0
  82. data/lib/{tasks/tasks_tasks.rake → tasuku/tasuku_tasks.rake} +0 -0
  83. data/lib/tasuku/version.rb +3 -0
  84. data/spec/controllers/{tasks → tasuku}/taskables/image/responses_controller_spec.rb +3 -3
  85. data/spec/controllers/{tasks → tasuku}/taskables/questions/answers_controller_spec.rb +3 -3
  86. data/spec/controllers/{tasks → tasuku}/taskables/text/responses_controller_spec.rb +3 -3
  87. data/spec/controllers/{tasks → tasuku}/taskables/verifications/confirmations_controller_spec.rb +3 -3
  88. data/spec/controllers/{tasks → tasuku}/tasks_controller_spec.rb +2 -2
  89. data/spec/dummy/config/application.rb +1 -1
  90. data/spec/dummy/db/schema.rb +29 -29
  91. data/spec/dummy/db/test.sqlite3 +0 -0
  92. data/spec/dummy/log/test.log +14611 -0
  93. data/spec/dummy/public/uploads/tasuku/taskables/image/request/image/1/doge.jpg +0 -0
  94. data/spec/dummy/public/uploads/tasuku/taskables/image/response/image/1/doge.jpg +0 -0
  95. data/spec/dummy/public/uploads/tasuku/taskables/question/image/1/doge.jpg +0 -0
  96. data/spec/dummy/public/uploads/tasuku/taskables/text/request/image/1/doge.jpg +0 -0
  97. data/spec/dummy/public/uploads/tasuku/taskables/url/request/image/1/doge.jpg +0 -0
  98. data/spec/dummy/public/uploads/tmp/1402401935-55786-0961/doge.jpg +0 -0
  99. data/spec/dummy/public/uploads/tmp/1402401935-55786-2854/doge.jpg +0 -0
  100. data/spec/dummy/public/uploads/tmp/1402402180-56033-5455/doge.jpg +0 -0
  101. data/spec/dummy/public/uploads/tmp/1402402180-56033-5512/doge.jpg +0 -0
  102. data/spec/factories/{tasks_taskables_image_requests.rb → tasuku_taskables_image_requests.rb} +1 -1
  103. data/spec/factories/{tasks_taskables_image_responses.rb → tasuku_taskables_image_responses.rb} +1 -1
  104. data/spec/factories/{tasks_taskables_question_answers.rb → tasuku_taskables_question_answers.rb} +1 -1
  105. data/spec/factories/{tasks_taskables_question_options.rb → tasuku_taskables_question_options.rb} +1 -1
  106. data/spec/factories/{tasks_taskables_question_votes.rb → tasuku_taskables_question_votes.rb} +1 -1
  107. data/spec/factories/{tasks_taskables_questions.rb → tasuku_taskables_questions.rb} +2 -2
  108. data/spec/factories/tasuku_taskables_text_requests.rb +5 -0
  109. data/spec/factories/tasuku_taskables_text_responses.rb +6 -0
  110. data/spec/factories/{tasks_taskables_url_requests.rb → tasuku_taskables_url_requests.rb} +1 -1
  111. data/spec/factories/{tasks_taskables_url_responses.rb → tasuku_taskables_url_responses.rb} +1 -1
  112. data/spec/factories/tasuku_taskables_verification_confirmations.rb +8 -0
  113. data/spec/factories/tasuku_taskables_verifications.rb +7 -0
  114. data/spec/factories/{tasks_tasks.rb → tasuku_tasks.rb} +4 -4
  115. data/spec/helpers/{tasks → tasuku}/taskables/verifications_helper_spec.rb +2 -2
  116. data/spec/lib/generators/views_generators_spec.rb +8 -8
  117. data/spec/lib/{tasks → tasuku}/concerns/verifiable_spec.rb +1 -1
  118. data/spec/models/tasuku/task_spec.rb +17 -0
  119. data/spec/models/{tasks → tasuku}/taskables/image/request_spec.rb +1 -1
  120. data/spec/models/{tasks → tasuku}/taskables/image/response_spec.rb +2 -5
  121. data/spec/models/{tasks → tasuku}/taskables/question/answer_spec.rb +3 -3
  122. data/spec/models/{tasks → tasuku}/taskables/question/option_spec.rb +1 -1
  123. data/spec/models/{tasks → tasuku}/taskables/question/vote_spec.rb +1 -1
  124. data/spec/models/{tasks → tasuku}/taskables/question_spec.rb +1 -1
  125. data/spec/models/{tasks → tasuku}/taskables/taskable/submission_spec.rb +1 -1
  126. data/spec/models/{tasks → tasuku}/taskables/taskable_spec.rb +1 -1
  127. data/spec/models/{tasks → tasuku}/taskables/text/request_spec.rb +1 -1
  128. data/spec/models/{tasks → tasuku}/taskables/text/response_spec.rb +3 -6
  129. data/spec/models/{tasks → tasuku}/taskables/url/request_spec.rb +1 -1
  130. data/spec/models/{tasks → tasuku}/taskables/url/response_spec.rb +1 -1
  131. data/spec/models/{tasks → tasuku}/taskables/verification/confirmation_spec.rb +1 -1
  132. data/spec/models/{tasks → tasuku}/taskables/verification_spec.rb +1 -1
  133. data/spec/support/trackable_submission_spec.rb +2 -2
  134. data/spec/views/{tasks → tasuku}/taskables/image/requests/_request.html.erb_spec.rb +3 -3
  135. data/spec/views/{tasks → tasuku}/taskables/image/responses/create.html.erb_spec.rb +0 -0
  136. data/spec/views/{tasks → tasuku}/taskables/questions/_question.html.erb_spec.rb +3 -3
  137. data/spec/views/{tasks → tasuku}/taskables/questions/answers/_form.html.erb_spec.rb +2 -2
  138. data/spec/views/{tasks → tasuku}/taskables/text/requests/_request.html.erb_spec.rb +3 -3
  139. data/spec/views/{tasks → tasuku}/taskables/url/requests/_request.html.erb_spec.rb +3 -3
  140. data/spec/views/{tasks → tasuku}/taskables/verifications/confirmations/_form.html.erb_spec.rb +2 -2
  141. data/spec/views/tasuku/tasks/show.html.erb_spec.rb +4 -0
  142. metadata +184 -190
  143. data/app/models/tasks/taskables/question/vote.rb +0 -6
  144. data/app/views/tasks/taskables/image/responses/_form.html.erb +0 -8
  145. data/app/views/tasks/taskables/image/responses/create.html.erb +0 -2
  146. data/app/views/tasks/taskables/text/responses/_form.html.erb +0 -5
  147. data/app/views/tasks/taskables/text/responses/create.html.erb +0 -2
  148. data/app/views/tasks/taskables/url/responses/_form.html.erb +0 -5
  149. data/app/views/tasks/taskables/url/responses/create.html.erb +0 -2
  150. data/app/views/tasks/taskables/verifications/confirmations/_form.html.erb +0 -3
  151. data/lib/generators/tasks/install/USAGE +0 -8
  152. data/lib/generators/tasks/install/install_generator.rb +0 -23
  153. data/lib/tasks.rb +0 -20
  154. data/lib/tasks/concerns.rb +0 -7
  155. data/lib/tasks/concerns/controllers.rb +0 -5
  156. data/lib/tasks/seeds.rb +0 -13
  157. data/lib/tasks/version.rb +0 -3
  158. data/spec/factories/tasks_taskables_text_requests.rb +0 -5
  159. data/spec/factories/tasks_taskables_text_responses.rb +0 -6
  160. data/spec/factories/tasks_taskables_verification_confirmations.rb +0 -8
  161. data/spec/factories/tasks_taskables_verifications.rb +0 -7
  162. data/spec/models/tasks/task_spec.rb +0 -20
  163. data/spec/models/tasks/taskables/taskable/response_spec.rb +0 -7
  164. data/spec/views/tasks/tasks/show.html.erb_spec.rb +0 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 178d927e42e8632c3e04c9b4aac2cd3dddbed77e
4
- data.tar.gz: 54d26f3a25a48853d7601e286b800daed8e2d118
3
+ metadata.gz: 0b0e37a9ae098ec1c1933a0d5d69d517a1ee9397
4
+ data.tar.gz: fab33f963e6b44883daa2d15b41ea90e9d4958d7
5
5
  SHA512:
6
- metadata.gz: 8d66367eaa1020978555af13a58f8a0b4a998e78db97964a47b5ac5163f558976efc422b5e69cc3d5863337dcfcf5367e4042a31a4cfd7eadd4c142bbf4a4ff5
7
- data.tar.gz: 3ef5129686febd7059ae1706e5e2af7740ee58b56edd4f559d0b352778f92e8cd73fa644380e178a00ef9f73588f2b71d3e835b491d6a297fc3afac96dd789c3
6
+ metadata.gz: d91280373ec8d16e6635a5bb647a4e931eb8ece9c5838cd0831dbb70ea5400d1ad53cb77f5095c291feec0151e7c479e7e61358ac53030f7364bf6f7af72b50e
7
+ data.tar.gz: 9b68f94763ad774632bf700b1b8c701e21929145fa2f6835584c3771621130bb224a4790c140efda6895339fd80db33a569f1b49b66611e078770271a1b93130
data/README.md CHANGED
@@ -22,7 +22,7 @@ Or install it yourself as:
22
22
 
23
23
  Install the gem:
24
24
 
25
- $ rails generate tasks:install
25
+ $ rails generate tasuku:install
26
26
 
27
27
  Run the migrations:
28
28
 
@@ -33,15 +33,15 @@ Then you can change the default configurations:
33
33
  ```ruby
34
34
  # config/routes.rb
35
35
  Rails.application.routes.draw do
36
- mount Tasks::Engine, at: '/tasks'
36
+ mount Tasuku::Engine, at: '/tasks'
37
37
  end
38
38
  ```
39
39
 
40
40
  And the method to use in deriving the current user:
41
41
 
42
42
  ```ruby
43
- # config/initializers/tasks.rb
44
- Tasks.configure do |config|
43
+ # config/initializers/tasuku.rb
44
+ Tasuku.configure do |config|
45
45
  config.author = :current_user
46
46
  end
47
47
  ```
@@ -51,7 +51,7 @@ end
51
51
  Tasuku ships with views, but you can copy them to customize things to your liking:
52
52
 
53
53
  ```
54
- $ rails generate tasks:views
54
+ $ rails generate tasuku:views
55
55
  ```
56
56
 
57
57
  Tasuku defaults to using your application's layout, so you'll need to prefix your own route helpers with `main_app` so Ruby on Rails knows where to look.
@@ -79,4 +79,4 @@ and if you're using this library we probably want to hire you.
79
79
 
80
80
  ## License
81
81
 
82
- Tasks is available under the MIT license. See the LICENSE file for more info.
82
+ Tasuku is available under the MIT license. See the LICENSE file for more info.
@@ -1,4 +1,4 @@
1
- module Tasks
1
+ module Tasuku
2
2
  class ApplicationController < ::ApplicationController
3
3
  private
4
4
 
@@ -1,6 +1,6 @@
1
- require_dependency "tasks/application_controller"
1
+ require_dependency 'tasuku/application_controller'
2
2
 
3
- module Tasks
3
+ module Tasuku
4
4
  class Taskables::Image::ResponsesController < ApplicationController
5
5
  include Concerns::Redirectable
6
6
 
@@ -1,6 +1,6 @@
1
- require_dependency "tasks/application_controller"
1
+ require_dependency 'tasuku/application_controller'
2
2
 
3
- module Tasks
3
+ module Tasuku
4
4
  class Taskables::Questions::AnswersController < ApplicationController
5
5
  include Concerns::Redirectable
6
6
 
@@ -1,6 +1,6 @@
1
- require_dependency "tasks/application_controller"
1
+ require_dependency 'tasuku/application_controller'
2
2
 
3
- module Tasks
3
+ module Tasuku
4
4
  class Taskables::Text::ResponsesController < ApplicationController
5
5
  include Concerns::Redirectable
6
6
 
@@ -1,6 +1,6 @@
1
- require_dependency "tasks/application_controller"
1
+ require_dependency 'tasuku/application_controller'
2
2
 
3
- module Tasks
3
+ module Tasuku
4
4
  class Taskables::URL::ResponsesController < ApplicationController
5
5
  include Concerns::Redirectable
6
6
 
@@ -1,6 +1,6 @@
1
- require_dependency "tasks/application_controller"
1
+ require_dependency 'tasuku/application_controller'
2
2
 
3
- module Tasks
3
+ module Tasuku
4
4
  class Taskables::Verifications::ConfirmationsController < ApplicationController
5
5
  include Concerns::Redirectable
6
6
 
@@ -1,6 +1,6 @@
1
- require_dependency "tasks/application_controller"
1
+ require_dependency 'tasuku/application_controller'
2
2
 
3
- module Tasks
3
+ module Tasuku
4
4
  class TasksController < ApplicationController
5
5
  include Concerns::Controllers::TasksController
6
6
  end
@@ -1,4 +1,4 @@
1
- module Tasks
1
+ module Tasuku
2
2
  module ApplicationHelper
3
3
  def current_author
4
4
  send Tasks.config.author
@@ -1,4 +1,4 @@
1
- module Tasks
1
+ module Tasuku
2
2
  module Taskables::VerificationsHelper
3
3
 
4
4
  # Render a button to confirm the given verification.
@@ -10,7 +10,7 @@ module Tasks
10
10
  # confirm terms_of_service.verification
11
11
  #
12
12
  def confirm verification
13
- render partial: 'tasks/taskables/verifications/confirmations/form.html.erb', locals: {
13
+ render partial: 'tasuku/taskables/verifications/confirmations/form.html.erb', locals: {
14
14
  confirmation: verification.confirmations.build
15
15
  }
16
16
  end
@@ -1,4 +1,4 @@
1
- module Tasks
1
+ module Tasuku
2
2
  class Task < ActiveRecord::Base
3
3
  include Concerns::Models::Task
4
4
  end
@@ -1,7 +1,7 @@
1
- module Tasks
1
+ module Tasuku
2
2
  module Taskables
3
3
  def self.table_name_prefix
4
- 'tasks_taskables_'
4
+ 'tasuku_taskables_'
5
5
  end
6
6
  end
7
7
  end
@@ -1,7 +1,7 @@
1
- module Tasks
1
+ module Tasuku
2
2
  module Taskables::Image
3
3
  def self.table_name_prefix
4
- 'tasks_taskables_image_'
4
+ 'tasuku_taskables_image_'
5
5
  end
6
6
  end
7
7
  end
@@ -1,4 +1,4 @@
1
- module Tasks
1
+ module Tasuku
2
2
  module Taskables
3
3
  class Image::Request < ActiveRecord::Base
4
4
  include Concerns::Models::Taskables::Image::Request
@@ -1,4 +1,4 @@
1
- module Tasks
1
+ module Tasuku
2
2
  module Taskables
3
3
  class Image::Response < ActiveRecord::Base
4
4
  include Taskable::Submission
@@ -1,4 +1,4 @@
1
- module Tasks
1
+ module Tasuku
2
2
  module Taskables
3
3
  class Question < ActiveRecord::Base
4
4
  include Concerns::Models::Taskables::Question
@@ -1,4 +1,4 @@
1
- module Tasks
1
+ module Tasuku
2
2
  module Taskables
3
3
  class Question::Answer < ActiveRecord::Base
4
4
  include Taskable::Submission
@@ -12,11 +12,7 @@ module Tasks
12
12
  validate :can_only_vote_once_for_single_choice_questions
13
13
 
14
14
  def question
15
- if votes.any?
16
- votes.first.option.question
17
- else
18
- raise StandardError, "Cannot derive question for #{self}, as it has no votes"
19
- end
15
+ votes.first.option.question if votes.any?
20
16
  end
21
17
 
22
18
  request is: :question
@@ -28,11 +24,11 @@ module Tasks
28
24
  private
29
25
 
30
26
  def can_only_answer_each_question_once
31
- errors.add :base, I18n.t('tasks.taskables.questions.answers.already_answered') if question.answers.find_by author: author
27
+ errors.add :base, I18n.t('tasuku.taskables.questions.answers.already_answered') if question && question.answers.find_by(author: author)
32
28
  end
33
29
 
34
30
  def can_only_vote_once_for_single_choice_questions
35
- errors.add :base, I18n.t('tasks.taskables.questions.answers.can_only_vote_once') if question.single? && votes.many?
31
+ errors.add :base, I18n.t('tasuku.taskables.questions.answers.can_only_vote_once') if question && question.single? && votes.many?
36
32
  end
37
33
  end
38
34
  end
@@ -1,4 +1,4 @@
1
- module Tasks
1
+ module Tasuku
2
2
  class Taskables::Question::Option < ActiveRecord::Base
3
3
  belongs_to :question
4
4
  has_many :votes
@@ -0,0 +1,6 @@
1
+ module Tasuku
2
+ class Taskables::Question::Vote < ActiveRecord::Base
3
+ belongs_to :answer, class_name: 'Tasuku::Taskables::Question::Answer'
4
+ belongs_to :option, class_name: 'Tasuku::Taskables::Question::Option'
5
+ end
6
+ end
@@ -1,4 +1,4 @@
1
- module Tasks
1
+ module Tasuku
2
2
  module Taskables::Taskable
3
3
  extend ActiveSupport::Concern
4
4
 
@@ -12,7 +12,7 @@ module Tasks
12
12
  end
13
13
 
14
14
  included do
15
- has_one :task, as: :taskable, class_name: '::Tasks::Task', dependent: :destroy
15
+ has_one :task, as: :taskable, class_name: '::Tasuku::Task', dependent: :destroy
16
16
  end
17
17
 
18
18
  module ClassMethods
@@ -1,6 +1,6 @@
1
- module Tasks
1
+ module Tasuku
2
2
  class Taskables::Taskable::Response < ActiveRecord::Base
3
- self.table_name = 'tasks_taskables_taskable_responses'
3
+ self.table_name = 'tasuku_taskables_taskable_responses'
4
4
 
5
5
  belongs_to :author, polymorphic: true
6
6
  belongs_to :submittable, polymorphic: true
@@ -1,4 +1,4 @@
1
- module Tasks
1
+ module Tasuku
2
2
  module Taskables::Taskable::Submission
3
3
  extend ActiveSupport::Concern
4
4
 
@@ -1,7 +1,7 @@
1
- module Tasks
1
+ module Tasuku
2
2
  module Taskables::Text
3
3
  def self.table_name_prefix
4
- 'tasks_taskables_text_'
4
+ 'tasuku_taskables_text_'
5
5
  end
6
6
  end
7
7
  end
@@ -1,4 +1,4 @@
1
- module Tasks
1
+ module Tasuku
2
2
  module Taskables
3
3
  class Text::Request < ActiveRecord::Base
4
4
  include Concerns::Models::Taskables::Text::Request
@@ -1,4 +1,4 @@
1
- module Tasks
1
+ module Tasuku
2
2
  module Taskables
3
3
  class Text::Response < ActiveRecord::Base
4
4
  include Taskable::Submission
@@ -1,7 +1,7 @@
1
- module Tasks
1
+ module Tasuku
2
2
  module Taskables::URL
3
3
  def self.table_name_prefix
4
- 'tasks_taskables_url_'
4
+ 'tasuku_taskables_url_'
5
5
  end
6
6
  end
7
7
  end
@@ -1,4 +1,4 @@
1
- module Tasks
1
+ module Tasuku
2
2
  class Taskables::URL::Request < ActiveRecord::Base
3
3
  include Concerns::Models::Taskables::URL::Request
4
4
  end
@@ -1,4 +1,4 @@
1
- module Tasks
1
+ module Tasuku
2
2
  module Taskables
3
3
  class URL::Response < ActiveRecord::Base
4
4
  include Taskable::Submission
@@ -1,7 +1,7 @@
1
- module Tasks
1
+ module Tasuku
2
2
  module Taskables
3
3
  class Verification < ActiveRecord::Base
4
- include Tasks::Concerns::Models::Taskables::Verification
4
+ include Tasuku::Concerns::Models::Taskables::Verification
5
5
  end
6
6
  end
7
7
  end
@@ -1,4 +1,4 @@
1
- module Tasks
1
+ module Tasuku
2
2
  module Taskables
3
3
  class Verification::Confirmation < ActiveRecord::Base
4
4
  include Taskable::Submission
@@ -1,6 +1,6 @@
1
1
  # encoding: utf-8
2
2
 
3
- class Tasks::ImageUploader < CarrierWave::Uploader::Base
3
+ class Tasuku::ImageUploader < CarrierWave::Uploader::Base
4
4
 
5
5
  # Include RMagick or MiniMagick support:
6
6
  # include CarrierWave::RMagick
@@ -14,6 +14,6 @@
14
14
  </div>
15
15
  <% else %>
16
16
  <div class="form">
17
- <%= render partial: 'tasks/taskables/image/responses/form', locals: { request: request } %>
17
+ <%= render partial: 'tasuku/taskables/image/responses/form', locals: { request: request } %>
18
18
  </div>
19
19
  <% end %>
@@ -0,0 +1,8 @@
1
+ <%= form_for request.responses.build, url: tasuku.image_request_responses_path(request_id: request.id), method: :post, html: { multipart: true } do |form| %>
2
+ <%= form.hidden_field :image, value: 0 %>
3
+ <%= form.file_field :image %>
4
+
5
+ <%= form.submit t('tasuku.taskables.images.responses.upload'), data: {
6
+ disable_with: t('tasuku.taskables.images.responses.uploading')
7
+ } %>
8
+ <% end %>
@@ -0,0 +1,2 @@
1
+ <h1>Taskables::Image::Responses#create</h1>
2
+ <p>Find me in app/views/tasuku/taskables/image/responses/create.html.erb</p>
@@ -6,7 +6,7 @@
6
6
  <div class="description"><%= question.description %></div>
7
7
 
8
8
  <% if question.completed_by? current_author %>
9
- <%= t 'tasks.taskables.questions.answers.already_answered' %>
9
+ <%= t 'tasuku.taskables.questions.answers.already_answered' %>
10
10
  <div class="answer">
11
11
  <% question.answers.by(current_author).each do |answer| %>
12
12
  <ul>
@@ -17,11 +17,11 @@
17
17
  <% end %>
18
18
 
19
19
  <% if question.show_statistics? %>
20
- <%= render 'tasks/taskables/questions/answers/statistics', question: question %>
20
+ <%= render 'tasuku/taskables/questions/answers/statistics', question: question %>
21
21
  <% end %>
22
22
  </div>
23
23
  <% else %>
24
24
  <div class="options">
25
- <%= render 'tasks/taskables/questions/answers/form', question: question %>
25
+ <%= render 'tasuku/taskables/questions/answers/form', question: question %>
26
26
  </div>
27
27
  <% end %>
@@ -1,4 +1,4 @@
1
- <%= form_for Tasks::Taskables::Question::Answer.new, url: tasks.question_answers_path(question_id: question.id), method: :post do |form| %>
1
+ <%= form_for Tasuku::Taskables::Question::Answer.new, url: tasuku.question_answers_path(question_id: question.id), method: :post do |form| %>
2
2
  <% question.options.each do |option| %>
3
3
  <div class="question option">
4
4
  <% if question.multiple? %>
@@ -12,5 +12,5 @@
12
12
  </div>
13
13
  <% end %>
14
14
 
15
- <%= form.submit t('tasks.taskables.questions.answers.submit') %>
15
+ <%= form.submit t('tasuku.taskables.questions.answers.submit') %>
16
16
  <% end %>
@@ -6,7 +6,7 @@
6
6
  <div class="description"><%= request.description %></div>
7
7
 
8
8
  <% if request.completed_by? current_author %>
9
- <%= t 'tasks.taskables.texts.responses.already_responded' %>
9
+ <%= t 'tasuku.taskables.texts.responses.already_responded' %>
10
10
  <div class="response">
11
11
  <% request.responses.by(current_user).each do |response| %>
12
12
  <%= response.text %>
@@ -14,6 +14,6 @@
14
14
  </div>
15
15
  <% else %>
16
16
  <div class="form">
17
- <%= render partial: 'tasks/taskables/text/responses/form', locals: { request: request } %>
17
+ <%= render partial: 'tasuku/taskables/text/responses/form', locals: { request: request } %>
18
18
  </div>
19
19
  <% end %>