Merge pull request #349 from openSUSE/review_140721_basic_rubocop_rules
[Review] Request from 'KalabiYau' @ 'openSUSE/osem/review_140721_basic_rubocop_rules'
This commit is contained in:
commit
d9d72eae07
103 changed files with 686 additions and 260 deletions
|
|
@ -2,8 +2,8 @@ class DeviseCreateUsers < ActiveRecord::Migration
|
|||
def up
|
||||
create_table(:users) do |t|
|
||||
## Database authenticatable
|
||||
t.string :email, :null => false, :default => ""
|
||||
t.string :encrypted_password, :null => false, :default => ""
|
||||
t.string :email, null: false, default: ""
|
||||
t.string :encrypted_password, null: false, default: ""
|
||||
|
||||
## Recoverable
|
||||
t.string :reset_password_token
|
||||
|
|
@ -13,7 +13,7 @@ class DeviseCreateUsers < ActiveRecord::Migration
|
|||
t.datetime :remember_created_at
|
||||
|
||||
## Trackable
|
||||
t.integer :sign_in_count, :default => 0
|
||||
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
|
||||
|
|
@ -36,9 +36,9 @@ class DeviseCreateUsers < ActiveRecord::Migration
|
|||
t.timestamps
|
||||
end
|
||||
|
||||
add_index :users, :email, :unique => true
|
||||
add_index :users, :reset_password_token, :unique => true
|
||||
add_index :users, :confirmation_token, :unique => true
|
||||
add_index :users, :email, unique: true
|
||||
add_index :users, :reset_password_token, unique: true
|
||||
add_index :users, :confirmation_token, unique: true
|
||||
# add_index :users, :unlock_token, :unique => true
|
||||
# add_index :users, :authentication_token, :unique => true
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,17 +1,17 @@
|
|||
class CreateConferencesTable < ActiveRecord::Migration
|
||||
def up
|
||||
create_table :conferences do |t|
|
||||
t.string :guid, :null => false
|
||||
t.string :title, :null => false
|
||||
t.string :short_title, :null => false
|
||||
t.string :guid, null: false
|
||||
t.string :title, null: false
|
||||
t.string :short_title, null: false
|
||||
t.string :social_tag
|
||||
t.string :contact_email, :null => false
|
||||
t.string :timezone, :null => false
|
||||
t.string :contact_email, null: false
|
||||
t.string :timezone, null: false
|
||||
t.string :html_export_path
|
||||
t.date :start_date, :null => false
|
||||
t.date :end_date, :null => false
|
||||
t.boolean :cfp_open, :default => false
|
||||
t.boolean :registration_open, :default => false
|
||||
t.date :start_date, null: false
|
||||
t.date :end_date, null: false
|
||||
t.boolean :cfp_open, default: false
|
||||
t.boolean :registration_open, default: false
|
||||
t.references :venue
|
||||
|
||||
t.timestamps
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
class CreatePeopleTable < ActiveRecord::Migration
|
||||
def up
|
||||
create_table :people do |t|
|
||||
t.string :guid, :null => false
|
||||
t.string :first_name, :default => ""
|
||||
t.string :last_name, :default => ""
|
||||
t.string :public_name, :default => ""
|
||||
t.string :company, :default => ""
|
||||
t.string :email, :null => false
|
||||
t.string :guid, null: false
|
||||
t.string :first_name, default: ""
|
||||
t.string :last_name, default: ""
|
||||
t.string :public_name, default: ""
|
||||
t.string :company, default: ""
|
||||
t.string :email, null: false
|
||||
t.boolean :email_public
|
||||
t.string :avatar_file_name
|
||||
t.string :avatar_content_type
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
class CreateRoomsTable < ActiveRecord::Migration
|
||||
def up
|
||||
create_table :rooms do |t|
|
||||
t.string :guid, :null => false
|
||||
t.string :guid, null: false
|
||||
t.references :conference
|
||||
t.string :name, :null => false
|
||||
t.string :name, null: false
|
||||
t.integer :size
|
||||
t.boolean :public, :default => true
|
||||
t.boolean :public, default: true
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
class CreateTracksTable < ActiveRecord::Migration
|
||||
def up
|
||||
create_table :tracks do |t|
|
||||
t.string :guid, :null => false
|
||||
t.string :guid, null: false
|
||||
t.references :conference
|
||||
t.string :name, :null => false
|
||||
t.string :name, null: false
|
||||
t.text :description
|
||||
t.string :color, :default => "#ffffff"
|
||||
t.string :color, default: "#ffffff"
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,19 +1,19 @@
|
|||
class CreateEventsTable < ActiveRecord::Migration
|
||||
def up
|
||||
create_table :events do |t|
|
||||
t.string :guid, :null => false
|
||||
t.string :guid, null: false
|
||||
t.references :conference
|
||||
t.references :event_type
|
||||
t.string :title, :null => false
|
||||
t.string :title, null: false
|
||||
t.string :subtitle
|
||||
t.integer :time_slots
|
||||
t.string :state, :null => false, :default => "new"
|
||||
t.string :progress, :null => false, :default => "new"
|
||||
t.string :state, null: false, default: "new"
|
||||
t.string :progress, null: false, default: "new"
|
||||
t.string :language
|
||||
t.datetime :start_time
|
||||
t.text :abstract
|
||||
t.text :description
|
||||
t.boolean :public, :default => true
|
||||
t.boolean :public, default: true
|
||||
t.string :logo_file_name
|
||||
t.string :logo_content_type
|
||||
t.integer :logo_file_size
|
||||
|
|
|
|||
|
|
@ -2,8 +2,8 @@ class CreateEventTypes < ActiveRecord::Migration
|
|||
def up
|
||||
create_table :event_types do |t|
|
||||
t.references :conference
|
||||
t.string :title, :null => false
|
||||
t.integer :length, :default => 30
|
||||
t.string :title, null: false
|
||||
t.integer :length, default: 30
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ class CreateEventPeopleTable < ActiveRecord::Migration
|
|||
t.references :proposal
|
||||
t.references :person
|
||||
t.references :event
|
||||
t.string :event_role, :null => false, :default => "participant"
|
||||
t.string :event_role, null: false, default: "participant"
|
||||
t.string :comment
|
||||
|
||||
t.timestamps
|
||||
|
|
|
|||
|
|
@ -15,5 +15,4 @@ class CreateVenueTable < ActiveRecord::Migration
|
|||
def down
|
||||
drop_table :venues
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
class UserRolesTable < ActiveRecord::Migration
|
||||
def self.up
|
||||
create_table :roles_users, :id => false do |t|
|
||||
create_table :roles_users, id: false do |t|
|
||||
t.references :role, :user
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
class CreateCfpTable < ActiveRecord::Migration
|
||||
def up
|
||||
create_table :call_for_papers do |t|
|
||||
t.date :start_date, :null => false
|
||||
t.date :end_date, :null => false
|
||||
t.date :hard_deadline, :null => false
|
||||
t.text :description, :null => false
|
||||
t.date :start_date, null: false
|
||||
t.date :end_date, null: false
|
||||
t.date :hard_deadline, null: false
|
||||
t.text :description, null: false
|
||||
t.references :conference
|
||||
|
||||
t.timestamps
|
||||
|
|
|
|||
|
|
@ -4,9 +4,9 @@ class CreateRegistrationsTable < ActiveRecord::Migration
|
|||
t.references :person
|
||||
t.references :conference
|
||||
|
||||
t.boolean :attending_social_events, :default => true
|
||||
t.boolean :attending_social_events_with_partner, :default => false
|
||||
t.boolean :using_affiliated_lodging, :default => true
|
||||
t.boolean :attending_social_events, default: true
|
||||
t.boolean :attending_social_events_with_partner, default: false
|
||||
t.boolean :using_affiliated_lodging, default: true
|
||||
t.date :arrival
|
||||
t.date :departure
|
||||
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
class CreateComments < ActiveRecord::Migration
|
||||
def self.up
|
||||
create_table :comments do |t|
|
||||
t.string :title, :limit => 50, :default => ""
|
||||
t.string :title, limit: 50, default: ""
|
||||
t.text :comment
|
||||
t.references :commentable, :polymorphic => true
|
||||
t.references :commentable, polymorphic: true
|
||||
t.references :user
|
||||
t.timestamps
|
||||
end
|
||||
|
|
|
|||
|
|
@ -2,12 +2,12 @@ class CreateEventAttachmentsTable < ActiveRecord::Migration
|
|||
def up
|
||||
create_table :event_attachments do |t|
|
||||
t.references :event
|
||||
t.string :title, :null => false
|
||||
t.string :title, null: false
|
||||
t.string :attachment_file_name
|
||||
t.string :attachment_content_type
|
||||
t.integer :attachment_file_size
|
||||
t.datetime :attachment_updated_at
|
||||
t.boolean :public, :default => true
|
||||
t.boolean :public, default: true
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ class RemoveCfpAndRegBooleansFromConferences < ActiveRecord::Migration
|
|||
end
|
||||
|
||||
def down
|
||||
add_column :conferences, :cfp_open, :default => false
|
||||
add_column :registration_open, :default => false
|
||||
add_column :conferences, :cfp_open, default: false
|
||||
add_column :registration_open, default: false
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
class CreateVersions < ActiveRecord::Migration
|
||||
def self.up
|
||||
create_table :versions do |t|
|
||||
t.string :item_type, :null => false
|
||||
t.integer :item_id, :null => false
|
||||
t.string :event, :null => false
|
||||
t.string :item_type, null: false
|
||||
t.integer :item_id, null: false
|
||||
t.string :event, null: false
|
||||
t.string :whodunnit
|
||||
t.text :object
|
||||
t.text :object_changes
|
||||
|
|
|
|||
|
|
@ -2,17 +2,16 @@ class CreateEmailTable < ActiveRecord::Migration
|
|||
def up
|
||||
create_table :email_settings do |t|
|
||||
t.references :conference
|
||||
t.boolean :send_on_registration, :default => true
|
||||
t.boolean :send_on_accepted, :default => true
|
||||
t.boolean :send_on_rejected, :default => true
|
||||
t.boolean :send_on_confirmed_without_registration, :default => true
|
||||
t.boolean :send_on_registration, default: true
|
||||
t.boolean :send_on_accepted, default: true
|
||||
t.boolean :send_on_rejected, default: true
|
||||
t.boolean :send_on_confirmed_without_registration, default: true
|
||||
t.text :registration_email_template
|
||||
t.text :accepted_email_template
|
||||
t.text :rejected_email_template
|
||||
t.text :confirmed_email_template
|
||||
t.timestamps
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
def down
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
class AddMinimumAndMaximumAbstractLengthsToEventTypes < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :event_types, :minimum_abstract_length, :integer, :default => 0
|
||||
add_column :event_types, :maximum_abstract_length, :integer, :default => 500
|
||||
add_column :event_types, :minimum_abstract_length, :integer, default: 0
|
||||
add_column :event_types, :maximum_abstract_length, :integer, default: 500
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
class AddDietaryChoiceToConferences < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :conferences, :use_dietary_choices, :boolean, :default => false
|
||||
add_column :conferences, :use_dietary_choices, :boolean, default: false
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ class CreateDietaryChoicesTable < ActiveRecord::Migration
|
|||
def up
|
||||
create_table :dietary_choices do |t|
|
||||
t.references :conference
|
||||
t.string :title, :null => false
|
||||
t.string :title, null: false
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
class AddHandicappedAccessToRegistrations < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :registrations, :handicapped_access_required, :boolean, :default => false
|
||||
add_column :registrations, :handicapped_access_required, :boolean, default: false
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ class CreateSupporterLevelTable < ActiveRecord::Migration
|
|||
def up
|
||||
create_table :supporter_levels do |t|
|
||||
t.references :conference
|
||||
t.string :title, :null => false
|
||||
t.string :title, null: false
|
||||
t.string :url
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ class CreateTableSupporterRegistrations < ActiveRecord::Migration
|
|||
t.string :name
|
||||
t.string :email
|
||||
t.string :code
|
||||
t.boolean :code_is_valid, :default => false
|
||||
t.boolean :code_is_valid, default: false
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
class AddUseSupporterLevelsToConferences < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :conferences, :use_supporter_levels, :boolean, :default => false
|
||||
add_column :conferences, :use_supporter_levels, :boolean, default: false
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
class CreateRegistrationsSocialEventsTable < ActiveRecord::Migration
|
||||
def up
|
||||
create_table :registrations_social_events, :id => false do |t|
|
||||
create_table :registrations_social_events, id: false do |t|
|
||||
t.references :registration, :social_event
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
class SetRegistrationDefaultsToFalse < ActiveRecord::Migration
|
||||
def up
|
||||
change_column :registrations, :using_affiliated_lodging, :boolean, :default => false
|
||||
change_column :registrations, :using_affiliated_lodging, :boolean, default: false
|
||||
end
|
||||
|
||||
def down
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ class ChangeAttachmentDefault < ActiveRecord::Migration
|
|||
def up
|
||||
change_column_default(:event_attachments, :public, true)
|
||||
end
|
||||
|
||||
def down
|
||||
change_column_default(:event_attachments, :public, nil)
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
class CreateEventsRegistrationsTable < ActiveRecord::Migration
|
||||
def up
|
||||
create_table :events_registrations, :id => false do |t|
|
||||
create_table :events_registrations, id: false do |t|
|
||||
t.references :registration, :event
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
class AddAttendedToRegistrations < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :registrations, :attended, :boolean, :default => 0
|
||||
add_column :registrations, :attended, :boolean, default: 0
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
class AddScheduleChangesToCallForPapers < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :call_for_papers, :schedule_changes, :boolean, :default => 0
|
||||
add_column :call_for_papers, :schedule_changes, :boolean, default: 0
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
class AddRatingToCallForPapers < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :call_for_papers, :rating, :integer, :null => 1
|
||||
add_column :call_for_papers, :rating, :integer, null: 1
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ class CreateVpositions < ActiveRecord::Migration
|
|||
def up
|
||||
create_table :vpositions do |t|
|
||||
t.references :conference
|
||||
t.string :title, :null => false
|
||||
t.string :title, null: false
|
||||
t.text :description
|
||||
|
||||
t.timestamps
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
class ChangeDefaultRatingInCallForPapers < ActiveRecord::Migration
|
||||
def up
|
||||
change_column :call_for_papers, :rating, :integer, :default => 3
|
||||
change_column :call_for_papers, :rating, :integer, default: 3
|
||||
end
|
||||
|
||||
def down
|
||||
change_column :call_for_papers, :rating, :integer, :null => 1
|
||||
change_column :call_for_papers, :rating, :integer, null: 1
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
class RegistrationsVchoices < ActiveRecord::Migration
|
||||
def up
|
||||
create_table :registrations_vchoices, :id => false do |t|
|
||||
create_table :registrations_vchoices, id: false do |t|
|
||||
t.references :registration, :vchoice
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
class CreateConferencesQuestions < ActiveRecord::Migration
|
||||
def change
|
||||
create_table :conferences_questions, :id => false do |t|
|
||||
create_table :conferences_questions, id: false do |t|
|
||||
t.references :conference
|
||||
t.references :question
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
class CreateQanswersRegistrations < ActiveRecord::Migration
|
||||
def change
|
||||
create_table :qanswers_registrations, :id => false do |t|
|
||||
t.references :registration, :null => false
|
||||
t.references :qanswer, :null => false
|
||||
create_table :qanswers_registrations, id: false do |t|
|
||||
t.references :registration, null: false
|
||||
t.references :qanswer, null: false
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ class CreateDifficultyLevels < ActiveRecord::Migration
|
|||
t.references :conference
|
||||
t.string :title
|
||||
t.text :description
|
||||
t.string :color, :default => "#ffffff"
|
||||
t.string :color, default: "#ffffff"
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
class AddUseDifficultyLevelsToConference < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :conferences, :use_difficulty_levels, :boolean, :default => false
|
||||
add_column :conferences, :use_difficulty_levels, :boolean, default: false
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
class UseVdaysVpositionsDefaults < ActiveRecord::Migration
|
||||
def up
|
||||
change_column :conferences, :use_vpositions, :boolean, :default => false
|
||||
change_column :conferences, :use_vdays, :boolean, :default => false
|
||||
change_column :conferences, :use_vpositions, :boolean, default: false
|
||||
change_column :conferences, :use_vdays, :boolean, default: false
|
||||
end
|
||||
|
||||
def down
|
||||
change_column :conferences, :use_vpositions, :boolean, :default => nil
|
||||
change_column :conferences, :use_vdays, :boolean, :default => nil
|
||||
change_column :conferences, :use_vpositions, :boolean, default: nil
|
||||
change_column :conferences, :use_vdays, :boolean, default: nil
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -30,6 +30,5 @@ class CreateEventUsers < ActiveRecord::Migration
|
|||
record.comment = ep.comment
|
||||
record.save!
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -65,15 +65,14 @@ class AddEventsPerWeekToConference < ActiveRecord::Migration
|
|||
conference.save
|
||||
end
|
||||
|
||||
|
||||
# Cumulate the previous weeks to get a snapshot
|
||||
TempConference.all.each do |conference|
|
||||
hash = conference.events_per_week.sort.to_h
|
||||
hash = conference.events_per_week.sort.to_hash
|
||||
previous = nil
|
||||
|
||||
hash.each do |week, values|
|
||||
if previous
|
||||
values.each do |state, value|
|
||||
values.each do |state, _value|
|
||||
hash[week][state] += previous[state]
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue