Open
Conversation
3d9ffd6 to
8eca96e
Compare
Added Rspec and Appraisals with minor tweaks Added Rspec and Appraisals Updated gitignore Updated Appraisals gemfiles
45bd0ab to
8ca4989
Compare
caapal
requested changes
Feb 7, 2023
app/models/survey/attempt.rb
Outdated
| scope :looses, -> { where(winner: false) } | ||
| scope :scores, -> { order('score DESC') } | ||
| scope :for_survey, ->(survey) { where(survey_id: survey.id) } | ||
| scope :exclude_survey, ->(survey) { where("NOT survey_id = #{survey.id}") } |
app/models/survey/attempt.rb
Outdated
| end | ||
|
|
||
| def collect_scores | ||
| answers.map(&:value).reduce(:+) || 0 |
Member
There was a problem hiding this comment.
We are changing the behavior here by not setting the self.score field like we used to
|
|
||
| def generate_active_admin_resolution | ||
| copy_file "active_admin.rb", "app/admin/survey.rb" | ||
| copy_file 'active_admin.rb', 'app/admin/survey.rb', force: true |
Author
There was a problem hiding this comment.
Forgot to remove, it was from previous tests
lib/survey.rb
Outdated
| require 'survey/active_record' | ||
|
|
||
| ActiveRecord::Base.send(:include, Survey::ActiveRecord) No newline at end of file | ||
| ActiveRecord::Base.include Survey::ActiveRecord |
Member
There was a problem hiding this comment.
Rails 5 added the ApplicationRecord. If the file exists, we should use it instead of ActiveRecord::Base
Author
There was a problem hiding this comment.
Hmmm okok, i will change it now 👍🏼
lib/survey/version.rb
Outdated
| module Survey | ||
| VERSION = "0.1" | ||
| end No newline at end of file | ||
| VERSION = '0.1' |
Author
There was a problem hiding this comment.
Bump version to 0.2?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
- Updated tests for spec
- Updated factories for factory_bot