Skip to content
This repository has been archived by the owner on Jul 22, 2022. It is now read-only.

Changes migration for devise 2, increases estimation points #252

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/assets/javascripts/models/story.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ Fulcrum.Story = Backbone.Model.extend({
},

point_values: function() {
return this.collection.project.get('point_values');
return this.collection.project.get('point_values').slice(0, 6);
},

// List available state transitions for this story
Expand Down
2 changes: 1 addition & 1 deletion app/helpers/projects_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module ProjectsHelper
# use in a select helper.
def point_scale_options
Project::POINT_SCALES.collect do |name,values|
["#{name.humanize} (#{values.join(',')})", name]
["#{name.humanize} (#{values.first(6).join(',')})", name]
end
end

Expand Down
6 changes: 3 additions & 3 deletions app/models/project.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ class Project < ActiveRecord::Base
# These are the valid point scalse for a project. These represent
# the set of valid points estimate values for a story in this project.
POINT_SCALES = {
'fibonacci' => [0,1,2,3,5,8],
'powers_of_two' => [0,1,2,4,8],
'linear' => [0,1,2,3,4,5],
'fibonacci' => [0,1,2,3,5,8,10,12,16,24,32,40],
'powers_of_two' => (0..40).step(2).to_a,
'linear' => (0..20).step(1).to_a,
}
validates_inclusion_of :point_scale, :in => POINT_SCALES.keys,
:message => "%{value} is not a valid estimation scheme"
Expand Down
52 changes: 44 additions & 8 deletions db/migrate/20110210082458_devise_create_users.rb
Original file line number Diff line number Diff line change
@@ -1,14 +1,50 @@
class DeviseCreateUsers < ActiveRecord::Migration
def self.up
create_table(:users) do |t|
t.database_authenticatable :null => false
t.recoverable
t.rememberable
t.trackable
t.confirmable
t.encryptable
# t.lockable :lock_strategy => :failed_attempts, :unlock_strategy => :both
# t.token_authenticatable
## Database authenticatable
## t.database_authenticatable :null => false
t.string :email, :null => false, :default => ""
t.string :encrypted_password, :null => false, :default => ""
## Recoverable
## t.recoverable
t.string :reset_password_token
#t.datetime :reset_password_sent_at

## Rememberable
## t.rememberable
t.datetime :remember_created_at

## Trackable
## t.trackable
t.integer :sign_in_count, :default => 0
t.datetime :current_sign_in_at
t.datetime :last_sign_in_at
t.string :current_sign_in_ip
t.string :last_sign_in_ip

## Encryptable
## t.encryptable
t.string :password_salt

## Confirmable
## t.confirmable
t.string :confirmation_token
t.datetime :confirmed_at
t.datetime :confirmation_sent_at
t.string :unconfirmed_email # Only if using reconfirmable

## Lockable
## t.lockable :lock_strategy => :failed_attempts, :unlock_strategy => :both
# t.integer :failed_attempts, :default => 0 # Only if lock strategy is :failed_attempts
# t.string :unlock_token # Only if unlock strategy is :email or :both
# t.datetime :locked_at

## Token authenticatable
## t.token_authenticatable
# t.string :authentication_token

## Invitable
# t.string :invitation_token


t.timestamps
Expand Down