source stringclasses 1
value | repo stringlengths 5 63 | repo_url stringlengths 24 82 | path stringlengths 5 167 | language stringclasses 1
value | license stringclasses 5
values | stars int64 10 51.4k | ref stringclasses 23
values | size_bytes int64 200 258k | text stringlengths 137 258k |
|---|---|---|---|---|---|---|---|---|---|
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | db/migrate/20090731092833_create_attendances.rb | Ruby | apache-2.0 | 95 | master | 351 | class CreateAttendances < ActiveRecord::Migration
def self.up
create_table :attendances do |t|
t.references :student
t.references :period_table_entry
t.boolean :forenoon, :default => false
t.boolean :afternoon, :default => false
t.string :reason
end
end
def self.down
dro... |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | db/migrate/20090818050018_create_timetable_entries.rb | Ruby | apache-2.0 | 95 | master | 332 | class CreateTimetableEntries < ActiveRecord::Migration
def self.up
create_table :timetable_entries do |t|
t.references :batch
t.references :week_day
t.references :class_timing
t.references :subject
t.references :employee
end
end
def self.down
drop_table :timetable_entrie... |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | db/migrate/20091217191652_create_privileges.rb | Ruby | apache-2.0 | 95 | master | 1,145 | class CreatePrivileges < ActiveRecord::Migration
def self.up
create_table :privileges do |t|
t.string :name
t.timestamps
end
Privilege.create :name => "ExaminationControl"
Privilege.create :name => "EnterResults"
Privilege.create :name => "ViewResults"
Privilege.create :name => "A... |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | db/migrate/20090904071642_create_employee_departments.rb | Ruby | apache-2.0 | 95 | master | 402 | class CreateEmployeeDepartments < ActiveRecord::Migration
def self.up
create_table :employee_departments do |t|
t.string :code
t.string :name
t.boolean :status
end
create_default
end
def self.down
drop_table :employee_departments
end
def self.create_default
EmployeeDep... |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | db/migrate/20100515063157_create_finance_fee_categories.rb | Ruby | apache-2.0 | 95 | master | 476 | class CreateFinanceFeeCategories < ActiveRecord::Migration
def self.up
create_table :finance_fee_categories do |t|
t.string :name
t.text :description
t.references :batch
# t.references :fee_collection
t.boolean :is_deleted , :null => false ,:default => false
t.b... |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | db/migrate/20100604103435_create_archived_employees.rb | Ruby | apache-2.0 | 95 | master | 1,887 | class CreateArchivedEmployees < ActiveRecord::Migration
def self.up
create_table :archived_employees do |t|
t.references :employee_category
t.string :employee_number
t.date :joining_date
t.string :first_name
t.string :middle_name
t.string :last_name
... |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | db/migrate/20091202050910_create_finance_transaction_categories.rb | Ruby | apache-2.0 | 95 | master | 711 | class CreateFinanceTransactionCategories < ActiveRecord::Migration
def self.up
create_table :finance_transaction_categories do |t|
t.string :name
t.string :description
t.boolean :is_income
t.boolean :deleted, :null => false, :default => false
end
create_defaults
end
def self... |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | db/migrate/20090904071905_create_employee_grades.rb | Ruby | apache-2.0 | 95 | master | 494 | class CreateEmployeeGrades < ActiveRecord::Migration
def self.up
create_table :employee_grades do |t|
t.string :name
t.integer :priority
t.boolean :status
t.integer :max_hours_day
t.integer :max_hours_week
end
create_default
end
def self.down
drop_table :employee_... |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | db/migrate/20100602115152_create_grouped_exams.rb | Ruby | apache-2.0 | 95 | master | 232 | class CreateGroupedExams < ActiveRecord::Migration
def self.up
create_table :grouped_exams do |t|
t.references :exam_group
t.references :batch
end
end
def self.down
drop_table :grouped_exams
end
end |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | db/migrate/20100426094532_create_assets.rb | Ruby | apache-2.0 | 95 | master | 335 | class CreateAssets < ActiveRecord::Migration
def self.up
create_table :assets do |t|
t.string :title
t.text :description
t.integer :amount
t.boolean :is_inactive,:default=>false
t.boolean :is_deleted,:default=>false
t.timestamps
end
end
def self.down
drop_table :as... |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | db/migrate/20091207090412_create_finance_fee_structure_elements.rb | Ruby | apache-2.0 | 95 | master | 507 | class CreateFinanceFeeStructureElements < ActiveRecord::Migration
def self.up
create_table :finance_fee_structure_elements do |t|
t.decimal :amount, :precision => 8, :scale => 2
t.string :label
t.references :batch
t.references :student_category
t.references :student
t.re... |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | db/migrate/20090818045411_create_class_timings.rb | Ruby | apache-2.0 | 95 | master | 943 | class CreateClassTimings < ActiveRecord::Migration
def self.up
create_table :class_timings do |t|
t.references :batch
t.string :name
t.time :start_time
t.time :end_time
t.boolean :is_break
end
create_defaults
end
def self.down
drop_table :class_tim... |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | db/migrate/20090622115927_create_archived_guardians.rb | Ruby | apache-2.0 | 95 | master | 728 | class CreateArchivedGuardians < ActiveRecord::Migration
def self.up
create_table :archived_guardians do |t|
t.references :ward
t.string :first_name
t.string :last_name
t.string :relation
t.string :email
t.string :office_phone1
t.string :office_pho... |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | db/migrate/20090717126241_create_elective_groups.rb | Ruby | apache-2.0 | 95 | master | 301 | class CreateElectiveGroups < ActiveRecord::Migration
def self.up
create_table :elective_groups do |t|
t.string :name
t.references :batch
t.boolean :is_deleted, :default => false
t.timestamps
end
end
def self.down
drop_table :elective_groups
end
end |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | db/migrate/20090622102004_create_configurations.rb | Ruby | apache-2.0 | 95 | master | 1,207 | class CreateConfigurations < ActiveRecord::Migration
def self.up
create_table :configurations do |t|
t.string :config_key
t.string :config_value
end
create_default
end
def self.down
drop_table :configurations
end
def self.create_default
Configuration.create :config_key => "In... |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | db/migrate/20100412105116_create_student_additional_fields.rb | Ruby | apache-2.0 | 95 | master | 255 | class CreateStudentAdditionalFields < ActiveRecord::Migration
def self.up
create_table :student_additional_fields do |t|
t.string :name
t.boolean :status
end
end
def self.down
drop_table :student_additional_fields
end
end |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | db/migrate/20100731055437_create_additional_exam_scores.rb | Ruby | apache-2.0 | 95 | master | 432 | class CreateAdditionalExamScores < ActiveRecord::Migration
def self.up
create_table :additional_exam_scores do |t|
t.references :student
t.references :additional_exam
t.decimal :marks, :precision => 7, :scale => 2
t.references :grading_level
t.string :remarks
t.boolean ... |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | db/migrate/20090917052349_create_employee_leave_types.rb | Ruby | apache-2.0 | 95 | master | 300 | class CreateEmployeeLeaveTypes < ActiveRecord::Migration
def self.up
create_table :employee_leave_types do |t|
t.string :name
t.string :code
t.boolean :status
t.string :max_leave_count
end
end
def self.down
drop_table :employee_leave_types
end
end |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | db/migrate/20091202053600_create_finance_transactions.rb | Ruby | apache-2.0 | 95 | master | 473 | class CreateFinanceTransactions < ActiveRecord::Migration
def self.up
create_table :finance_transactions do |t|
t.string :title
t.string :description
t.decimal :amount, :precision => 8, :scale => 2
t.boolean :fine_included, :default => false
t.references :category
... |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | db/migrate/20090622114927_create_guardians.rb | Ruby | apache-2.0 | 95 | master | 702 | class CreateGuardians < ActiveRecord::Migration
def self.up
create_table :guardians do |t|
t.references :ward
t.string :first_name
t.string :last_name
t.string :relation
t.string :email
t.string :office_phone1
t.string :office_phone2
t.strin... |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | db/migrate/20100412105036_create_student_additional_details.rb | Ruby | apache-2.0 | 95 | master | 313 | class CreateStudentAdditionalDetails < ActiveRecord::Migration
def self.up
create_table :student_additional_details do |t|
t.references :student
t.references :additional_field
t.string :additional_info
end
end
def self.down
drop_table :student_additional_details
end
end |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | db/migrate/20090904071907_employee_bank_details.rb | Ruby | apache-2.0 | 95 | master | 277 | class EmployeeBankDetails < ActiveRecord::Migration
def self.up
create_table :employee_bank_details do |t|
t.references :employee
t.references :bank_field
t.string :bank_info
end
end
def self.down
drop_table :employee_bank_details
end
end |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | db/migrate/20090715234258_create_batch_students_join_table.rb | Ruby | apache-2.0 | 95 | master | 256 | class CreateBatchStudentsJoinTable < ActiveRecord::Migration
def self.up
create_table :batch_students, :id => false do |t|
t.references :student
t.references :batch
end
end
def self.down
drop_table :batch_students
end
end |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | db/migrate/20090904071908_create_additional_fields.rb | Ruby | apache-2.0 | 95 | master | 232 | class CreateAdditionalFields < ActiveRecord::Migration
def self.up
create_table :additional_fields do |t|
t.string :name
t.boolean :status
end
end
def self.down
drop_table :additional_fields
end
end |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | db/migrate/20100403092229_create_batch_events.rb | Ruby | apache-2.0 | 95 | master | 243 | class CreateBatchEvents < ActiveRecord::Migration
def self.up
create_table :batch_events do |t|
t.references :event
t.references :batch
t.timestamps
end
end
def self.down
drop_table :batch_events
end
end |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | db/migrate/20100524093457_create_electives.rb | Ruby | apache-2.0 | 95 | master | 218 | class CreateElectives < ActiveRecord::Migration
def self.up
create_table :electives do |t|
t.references :elective_group
t.timestamps
end
end
def self.down
drop_table :electives
end
end |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | db/migrate/20100720104231_create_xmls.rb | Ruby | apache-2.0 | 95 | master | 460 | class CreateXmls < ActiveRecord::Migration
def self.up
create_table :xmls do |t|
t.string :finance_name
t.string :ledger_name
t.timestamps
end
create_default
end
def self.down
drop_table :xmls
end
def self.create_default
Xml.create :finance_name =>"Salary", :ledger_... |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | db/migrate/20090622100004_create_users.rb | Ruby | apache-2.0 | 95 | master | 733 | class CreateUsers < ActiveRecord::Migration
def self.up
create_table :users do |t|
t.string :username
t.string :first_name
t.string :last_name
t.string :email
t.boolean :admin
t.boolean :student
t.boolean :employee
t.string :hashed_password
... |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | db/migrate/20100520073311_create_sms_settings.rb | Ruby | apache-2.0 | 95 | master | 1,000 | class CreateSmsSettings < ActiveRecord::Migration
def self.up
create_table :sms_settings do |t|
t.string :settings_key
t.boolean :is_enabled, :default=>false
end
create_default
end
def self.down
drop_table :sms_settings
end
def self.create_default
SmsSetting.create :settings_... |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | db/migrate/20090914114212_create_employee_salary_structures.rb | Ruby | apache-2.0 | 95 | master | 306 | class CreateEmployeeSalaryStructures < ActiveRecord::Migration
def self.up
create_table :employee_salary_structures do |t|
t.references :employee
t.references :payroll_category
t.string :amount
end
end
def self.down
drop_table :employee_salary_structures
end
end |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | db/migrate/20100403093355_create_employee_department_events.rb | Ruby | apache-2.0 | 95 | master | 298 | class CreateEmployeeDepartmentEvents < ActiveRecord::Migration
def self.up
create_table :employee_department_events do |t|
t.references :event
t.references :employee_department
t.timestamps
end
end
def self.down
drop_table :employee_department_events
end
end |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | db/migrate/20090718050453_create_exam_groups.rb | Ruby | apache-2.0 | 95 | master | 384 | class CreateExamGroups < ActiveRecord::Migration
def self.up
create_table :exam_groups do |t|
t.string :name
t.references :batch
t.string :exam_type
t.boolean :is_published, :default=>false
t.boolean :result_published, :default=>false
t.date :exam_date
e... |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | db/migrate/20090717124241_create_subjects.rb | Ruby | apache-2.0 | 95 | master | 427 | class CreateSubjects < ActiveRecord::Migration
def self.up
create_table :subjects do |t|
t.string :name
t.string :code
t.references :batch
t.boolean :no_exams, :default=>false
t.integer :max_weekly_classes
t.references :elective_group
t.boolean :is_delete... |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | db/migrate/20091207085849_create_finance_fees.rb | Ruby | apache-2.0 | 95 | master | 267 | class CreateFinanceFees < ActiveRecord::Migration
def self.up
create_table :finance_fees do |t|
t.references :fee_collection
t.references :transaction
t.references :student
end
end
def self.down
drop_table :finance_fees
end
end |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | db/migrate/20090718050921_create_exams.rb | Ruby | apache-2.0 | 95 | master | 465 | class CreateExams < ActiveRecord::Migration
def self.up
create_table :exams do |t|
t.references :exam_group
t.references :subject
t.datetime :start_time
t.datetime :end_time
t.integer :maximum_marks
t.integer :minimum_marks
t.references :grading_level
t.in... |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | db/migrate/20090924081520_create_apply_leaves.rb | Ruby | apache-2.0 | 95 | master | 510 | class CreateApplyLeaves < ActiveRecord::Migration
def self.up
create_table :apply_leaves do |t|
t.references :employee
t.references :employee_leave_types
t.boolean :is_half_day
t.date :start_date
t.date :end_date
t.string :reason
t.boolean :ap... |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | db/migrate/20100604103916_create_archived_employee_salary_structures.rb | Ruby | apache-2.0 | 95 | master | 332 | class CreateArchivedEmployeeSalaryStructures < ActiveRecord::Migration
def self.up
create_table :archived_employee_salary_structures do |t|
t.references :employee
t.references :payroll_category
t.string :amount
end
end
def self.down
drop_table :archived_employee_salary_structure... |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | db/migrate/20090703074822_create_countries.rb | Ruby | apache-2.0 | 95 | master | 4,508 | class CreateCountries < ActiveRecord::Migration
def self.up
create_table :countries do |t|
t.string :name
end
create_default
end
def self.down
drop_table :countries
end
def self.create_default
clist = [ "Afghanistan",
"Albania",
"Algeria",
"Andorra",
... |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | db/migrate/20100609073016_create_student_previous_datas.rb | Ruby | apache-2.0 | 95 | master | 344 | class CreateStudentPreviousDatas < ActiveRecord::Migration
def self.up
create_table :student_previous_datas do |t|
t.references :student
t.string :institution
t.string :year
t.string :course
t.string :total_mark
end
end
def self.down
drop_table :student_p... |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | db/migrate/20091207084711_create_finance_fee_collections.rb | Ruby | apache-2.0 | 95 | master | 443 | class CreateFinanceFeeCollections < ActiveRecord::Migration
def self.up
create_table :finance_fee_collections do |t|
t.string :name
t.date :start_date
t.date :end_date
t.date :due_date
t.references :fee_category
t.references :batch
t.boolean :is_d... |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | db/migrate/20100604104308_create_archived_employee_bank_details.rb | Ruby | apache-2.0 | 95 | master | 315 | class CreateArchivedEmployeeBankDetails < ActiveRecord::Migration
def self.up
create_table :archived_employee_bank_details do |t|
t.references :employee
t.references :bank_field
t.string :bank_info
end
end
def self.down
drop_table :archived_employee_bank_details
end
end |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | db/migrate/20100731054033_create_additional_exams.rb | Ruby | apache-2.0 | 95 | master | 526 | class CreateAdditionalExams < ActiveRecord::Migration
def self.up
create_table :additional_exams do |t|
t.references :additional_exam_group
t.references :subject
t.datetime :start_time
t.datetime :end_time
t.integer :maximum_marks
t.integer :minimum_marks
t.refe... |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | db/migrate/20100731053458_create_additional_exam_groups.rb | Ruby | apache-2.0 | 95 | master | 448 | class CreateAdditionalExamGroups < ActiveRecord::Migration
def self.up
create_table :additional_exam_groups do |t|
t.string :name
t.references :batch
t.string :exam_type
t.boolean :is_published, :default=>false
t.boolean :result_published, :default=>false
t.string... |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | db/migrate/20091224063502_create_finance_transaction_triggers.rb | Ruby | apache-2.0 | 95 | master | 375 | class CreateFinanceTransactionTriggers < ActiveRecord::Migration
def self.up
create_table :finance_transaction_triggers do |t|
t.references :finance_category
t.decimal :percentage, :precision => 8, :scale => 2
t.string :title
t.string :description
end
end
def self.down
... |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | db/migrate/20090910062751_create_employees.rb | Ruby | apache-2.0 | 95 | master | 2,238 | class CreateEmployees < ActiveRecord::Migration
def self.up
create_table :employees do |t|
t.references :employee_category
t.string :employee_number
t.date :joining_date
t.string :first_name
t.string :middle_name
t.string :last_name
t.boolean :gen... |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | db/migrate/20090916052300_create_monthly_payslips.rb | Ruby | apache-2.0 | 95 | master | 403 | class CreateMonthlyPayslips < ActiveRecord::Migration
def self.up
create_table :monthly_payslips do |t|
t.date :salary_date
t.references :employee
t.references :payroll_category
t.string :amount
t.boolean :is_approved,:null => false, :default => false
t.references :... |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | db/migrate/20090622104053_create_students.rb | Ruby | apache-2.0 | 95 | master | 1,443 | class CreateStudents < ActiveRecord::Migration
def self.up
create_table :students do |t|
t.string :admission_no
t.string :class_roll_no
t.date :admission_date
t.string :first_name
t.string :middle_name
t.string :last_name
t.references :batch
... |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | db/migrate/20090904071906_bank_fields.rb | Ruby | apache-2.0 | 95 | master | 204 | class BankFields < ActiveRecord::Migration
def self.up
create_table :bank_fields do |t|
t.string :name
t.boolean :status
end
end
def self.down
drop_table :bank_fields
end
end |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | db/migrate/20100505075459_create_weekdays.rb | Ruby | apache-2.0 | 95 | master | 500 | class CreateWeekdays < ActiveRecord::Migration
def self.up
create_table :weekdays do |t|
t.references :batch
t.string :weekday
end
create_default
end
def self.down
drop_table :weekdays
end
def self.create_default
Weekday.create :batch_id=>"", :weekday=>"1"
Weekday.create :... |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | db/migrate/20090926071527_create_employees_subjects.rb | Ruby | apache-2.0 | 95 | master | 247 | class CreateEmployeesSubjects < ActiveRecord::Migration
def self.up
create_table :employees_subjects do |t|
t.references :employee
t.references :subject
end
end
def self.down
drop_table :employees_subjects
end
end |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | db/migrate/20100403073735_create_events.rb | Ruby | apache-2.0 | 95 | master | 472 | class CreateEvents < ActiveRecord::Migration
def self.up
create_table :events do |t|
t.string :title
t.string :description
t.datetime :start_date
t.datetime :end_date
t.boolean :is_common, :default => false
t.boolean :is_holiday, :default => false
t.boolean :is_ex... |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | db/migrate/20091217201118_create_privileges_users_join_table.rb | Ruby | apache-2.0 | 95 | master | 264 | class CreatePrivilegesUsersJoinTable < ActiveRecord::Migration
def self.up
create_table :privileges_users, :id => false do |t|
t.references(:user)
t.references(:privilege)
end
end
def self.down
drop_table :privileges_users
end
end |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | db/migrate/20100515063814_create_finance_fee_particulars.rb | Ruby | apache-2.0 | 95 | master | 550 | class CreateFinanceFeeParticulars < ActiveRecord::Migration
def self.up
create_table :finance_fee_particulars do |t|
t.string :name
t.text :description
t.decimal :amount, :precision => 8, :scale => 2
t.references :finance_fee_category
t.references :student_category
... |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | db/migrate/20090904071548_create_employee_positions.rb | Ruby | apache-2.0 | 95 | master | 421 | class CreateEmployeePositions < ActiveRecord::Migration
def self.up
create_table :employee_positions do |t|
t.string :name
t.references :employee_category
t.boolean :status
end
create_default
end
def self.down
drop_table :employee_positions
end
def self.create_default
... |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | db/migrate/20100422110336_create_liabilities.rb | Ruby | apache-2.0 | 95 | master | 349 | class CreateLiabilities < ActiveRecord::Migration
def self.up
create_table :liabilities do |t|
t.string :title
t.text :description
t.integer :amount
t.boolean :is_solved,:default=>false
t.boolean :is_deleted, :default=>false
t.timestamps
end
end
def self.down
drop_... |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | db/migrate/20091026065251_create_reminders.rb | Ruby | apache-2.0 | 95 | master | 441 | class CreateReminders < ActiveRecord::Migration
def self.up
create_table :reminders do |t|
t.integer :sender
t.integer :recipient
t.string :subject
t.text :body
t.boolean :is_read, :default=>false
t.boolean :is_deleted_by_sender, :default=>false
t.boolean :is_del... |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | db/migrate/20090917065256_create_employee_attendances.rb | Ruby | apache-2.0 | 95 | master | 360 | class CreateEmployeeAttendances < ActiveRecord::Migration
def self.up
create_table :employee_attendances do |t|
t.date :attendance_date
t.references :employee
t.references :employee_leave_type
t.string :reason
t.boolean :is_half_day
end
end
def self.down
dro... |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | db/migrate/20090904071909_create_employee_additional_details.rb | Ruby | apache-2.0 | 95 | master | 318 | class CreateEmployeeAdditionalDetails < ActiveRecord::Migration
def self.up
create_table :employee_additional_details do |t|
t.references :employee
t.references :additional_field
t.string :additional_info
end
end
def self.down
drop_table :employee_additional_details
end
end |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | db/migrate/20090715234257_create_courses_and_batches.rb | Ruby | apache-2.0 | 95 | master | 604 | class CreateCoursesAndBatches < ActiveRecord::Migration
def self.up
create_table :courses do |t|
t.string :course_name
t.string :code
t.string :section_name
t.boolean :is_deleted, :default => false
t.timestamps
end
create_table :batches do |t|
t.string ... |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | db/migrate/20090706170408_create_news.rb | Ruby | apache-2.0 | 95 | master | 426 | class CreateNews < ActiveRecord::Migration
def self.up
create_table :news do |t|
t.string :title
t.text :content
t.references :author
t.timestamps
end
create_table :news_comments do |t|
t.text :content
t.references :news
t.references :author
... |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | db/migrate/20091202104818_create_finance_donations.rb | Ruby | apache-2.0 | 95 | master | 354 | class CreateFinanceDonations < ActiveRecord::Migration
def self.up
create_table :finance_donations do |t|
t.string :donor
t.string :description
t.decimal :amount, :precision => 12, :scale => 2
t.references :transaction
t.timestamps
end
end
def self.down
drop_t... |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | db/migrate/20100604104759_create_archived_employee_additional_details.rb | Ruby | apache-2.0 | 95 | master | 344 | class CreateArchivedEmployeeAdditionalDetails < ActiveRecord::Migration
def self.up
create_table :archived_employee_additional_details do |t|
t.references :employee
t.references :additional_field
t.string :additional_info
end
end
def self.down
drop_table :archived_employee_addit... |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | db/migrate/20090904071048_create_employee_categories.rb | Ruby | apache-2.0 | 95 | master | 402 | class CreateEmployeeCategories < ActiveRecord::Migration
def self.up
create_table :employee_categories do |t|
t.string :name
t.string :prefix
t.boolean :status
end
create_default
end
def self.down
drop_table :employee_categories
end
def self.create_default
EmployeeCat... |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | db/migrate/20090718050113_create_grading_levels.rb | Ruby | apache-2.0 | 95 | master | 763 | class CreateGradingLevels < ActiveRecord::Migration
def self.up
create_table :grading_levels do |t|
t.string :name
t.references :batch
t.integer :min_score
t.integer :order
t.boolean :is_deleted, :default => false
t.timestamps
end
create_default
end
... |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | db/migrate/20100609074544_create_student_previous_subject_marks.rb | Ruby | apache-2.0 | 95 | master | 303 | class CreateStudentPreviousSubjectMarks < ActiveRecord::Migration
def self.up
create_table :student_previous_subject_marks do |t|
t.references :student
t.string :subject
t.string :mark
end
end
def self.down
drop_table :student_previous_subject_marks
end
end |
github | vrish88/sinatra_cyclist | https://github.com/vrish88/sinatra_cyclist | sinatra_cyclist.gemspec | Ruby | mit | 94 | master | 785 | # -*- encoding: utf-8 -*-
require File.expand_path('../lib/sinatra/cyclist/version', __FILE__)
Gem::Specification.new do |gem|
gem.authors = ["Michael Lavrisha"]
gem.email = ["michael.lavrisha@gmail.com"]
gem.description = %q{Cycle through pages at a regular interval}
gem.summary = %q{Sin... |
github | vrish88/sinatra_cyclist | https://github.com/vrish88/sinatra_cyclist | examples/modular_application.rb | Ruby | mit | 94 | master | 240 | require "sinatra/base"
require "sinatra/cyclist"
class MyApp < Sinatra::Base
register Sinatra::Cyclist
set :routes_to_cycle_through, [:page_1, :page_2]
get "/page_1" do
"Page 1"
end
get "/page_2" do
"Page 2"
end
end |
github | vrish88/sinatra_cyclist | https://github.com/vrish88/sinatra_cyclist | lib/sinatra/cyclist.rb | Ruby | mit | 94 | master | 1,034 | require "sinatra/base"
require_relative "cyclist/version"
module Sinatra
module Cyclist
def self.registered(app)
app.enable :sessions
app.set :routes_to_cycle_through, []
app.set :cycle_duration, 3
app.get "/_cycle" do
return if settings.routes_to_cycle_through.empty?
pa... |
github | mislav/gorgeous | https://github.com/mislav/gorgeous | gorgeous.gemspec | Ruby | mit | 95 | master | 625 | # -*- encoding: utf-8 -*-
Gem::Specification.new do |gem|
gem.name = 'gorgeous'
gem.version = '0.2.0'
gem.add_dependency 'nokogiri'
gem.add_dependency 'activesupport'
gem.add_dependency 'rack'
gem.add_dependency 'mail'
gem.summary = "Convert between different data formats; prettify JSON, HTML and XM... |
github | mislav/gorgeous | https://github.com/mislav/gorgeous | lib/gorgeous.rb | Ruby | mit | 95 | master | 5,336 | class Gorgeous
def self.filename_to_format(filename)
case File.extname(filename)
when '.json' then :json
when '.xml', '.html' then :xml
when '.rb' then :ruby
when '.yml', '.yaml' then :yaml
when '.mail', '.email' then :email
end
end
PRETTY = File.expand_path('../pretty.xslt', __FILE__... |
github | locomotivecms/custom_fields | https://github.com/locomotivecms/custom_fields | Rakefile | Ruby | mit | 95 | master | 593 | #!/usr/bin/env rake
# frozen_string_literal: true
require 'rubygems'
require 'bundler/setup'
require 'bundler/gem_tasks'
require 'rake'
require 'rspec'
# === Gems install tasks ===
Bundler::GemHelper.install_tasks
require_relative 'lib/custom_fields'
# === RSpec ===
require 'rspec/core/rake_task'
RSpec::Core::Rak... |
github | locomotivecms/custom_fields | https://github.com/locomotivecms/custom_fields | Gemfile | Ruby | mit | 95 | master | 558 | #!/usr/bin/env bundle
# frozen_string_literal: true
source 'https://rubygems.org'
gemspec # Include gemspec dependencies
gem 'carrierwave-google-storage', require: false
gem 'database_cleaner-mongoid', '~> 2.0.1'
gem 'pry-byebug', '~> 3.10.1'
gem 'rake', '~> 13.0.6'
gem 'rubocop', require: false
gem 'bigdecimal'
ge... |
github | locomotivecms/custom_fields | https://github.com/locomotivecms/custom_fields | custom_fields.gemspec | Ruby | mit | 95 | master | 1,176 | #!/usr/bin/env gem build
# frozen_string_literal: true
lib = File.expand_path 'lib', __dir__
$LOAD_PATH.unshift lib unless $LOAD_PATH.include? lib
require 'custom_fields/version'
Gem::Specification.new 'custom_fields', CustomFields::VERSION do |spec|
spec.summary = 'Custom fields extension for Mongoid.'
spec... |
github | locomotivecms/custom_fields | https://github.com/locomotivecms/custom_fields | lib/custom_fields.rb | Ruby | mit | 95 | master | 2,000 | # frozen_string_literal: true
$LOAD_PATH.unshift __dir__
require 'active_support'
require 'carrierwave/mongoid'
require 'monetize'
require 'bcrypt'
Money.locale_backend = :currency
module CustomFields
# Regexp to check if a Ruby class has been built by the CustomFields gem
KLASS_REGEXP = /(.*)([0-9a-fA-F]{24})$... |
github | locomotivecms/custom_fields | https://github.com/locomotivecms/custom_fields | lib/custom_fields/source.rb | Ruby | mit | 95 | master | 13,041 | # frozen_string_literal: true
module CustomFields
module Source
extend ActiveSupport::Concern
included do
cattr_accessor :_custom_fields_for
self._custom_fields_for = []
attr_accessor :_custom_fields_diff
attr_accessor :_custom_field_localize_diff
end
# Determines if the re... |
github | locomotivecms/custom_fields | https://github.com/locomotivecms/custom_fields | lib/custom_fields/target_helpers.rb | Ruby | mit | 95 | master | 6,155 | # frozen_string_literal: true
module CustomFields
module TargetHelpers
# Return the list of the getters dynamically based on the
# custom_fields recipe in order to get the formatted values
# of the custom fields.
# If a block is passed, then the list will be filtered accordingly with
# the follow... |
github | locomotivecms/custom_fields | https://github.com/locomotivecms/custom_fields | lib/custom_fields/target.rb | Ruby | mit | 95 | master | 3,111 | # frozen_string_literal: true
module CustomFields
module Target
extend ActiveSupport::Concern
included do
## types ##
%w[default string text email date date_time boolean file select
float integer money color belongs_to has_many many_to_many
tags password json].each do |type|
... |
github | locomotivecms/custom_fields | https://github.com/locomotivecms/custom_fields | lib/custom_fields/field.rb | Ruby | mit | 95 | master | 3,057 | # frozen_string_literal: true
module CustomFields
class Field
include ::Mongoid::Document
include ::Mongoid::Timestamps
AVAILABLE_TYPES = %w[default string text email date date_time boolean file select float integer
money tags color relationship_default belongs_to has_many many_... |
github | locomotivecms/custom_fields | https://github.com/locomotivecms/custom_fields | lib/custom_fields/extensions/active_support.rb | Ruby | mit | 95 | master | 982 | # frozen_string_literal: true
module CustomFieldsStringExtension
def constantize
super
rescue NameError => e
# DEBUG: puts "constantizing #{self.inspect}"
# alright, does it look like a custom_fields dynamic klass ?
if self =~ CustomFields::KLASS_REGEXP
base = ::Regexp.last_match(1).constanti... |
github | locomotivecms/custom_fields | https://github.com/locomotivecms/custom_fields | lib/custom_fields/extensions/carrierwave.rb | Ruby | mit | 95 | master | 1,127 | # frozen_string_literal: true
require 'carrierwave/mongoid'
module CarrierWave
class Mounter
def remove_previous_with_localization(before = nil, after = nil)
_before = before
_after = after
locale = ::Mongoid::Fields::I18n.locale.to_s
# custom case:
# the record owns a localized f... |
github | locomotivecms/custom_fields | https://github.com/locomotivecms/custom_fields | lib/custom_fields/extensions/origin/smash.rb | Ruby | mit | 95 | master | 970 | # frozen_string_literal: true
module Origin
# This is a smart hash for use with options and selectors.
class Smash < Hash
private
# Get the normalized value for the key. If localization is in play the
# current locale will be appended to the key in MongoDB dot notation.
#
# FIXME (Did).
# ... |
github | locomotivecms/custom_fields | https://github.com/locomotivecms/custom_fields | lib/custom_fields/extensions/mongoid/document.rb | Ruby | mit | 95 | master | 353 | # frozen_string_literal: true
module Mongoid # :nodoc:
module Document # :nodoc:
module ClassMethods # :nodoc:
# The mongoid default document returns always false.
# The documents with custom fields return true.
#
# @return [ Boolean ] False
#
def with_custom_fields?
f... |
github | locomotivecms/custom_fields | https://github.com/locomotivecms/custom_fields | lib/custom_fields/extensions/mongoid/fields.rb | Ruby | mit | 95 | master | 847 | # frozen_string_literal: true
# :nodoc
module Mongoid
# This module defines behaviour for fields.
module Fields
module ClassMethods
# Replace a field with a new type.
#
# @example Replace the field.
# Model.replace_field("_id", String)
#
# @param [ String ] name The name ... |
github | locomotivecms/custom_fields | https://github.com/locomotivecms/custom_fields | lib/custom_fields/extensions/mongoid/factory.rb | Ruby | mit | 95 | master | 647 | # frozen_string_literal: true
module Mongoid # :nodoc:
# Instantiates documents that came from the database.
module Factory
def from_db_with_custom_fields(klass, attributes = nil, criteria = nil, selected_fields = nil)
klass.klass_with_custom_fields(attributes['custom_fields_recipe']) if klass.with_custo... |
github | locomotivecms/custom_fields | https://github.com/locomotivecms/custom_fields | lib/custom_fields/extensions/mongoid/validatable/macros.rb | Ruby | mit | 95 | master | 643 | # frozen_string_literal: true
module Mongoid
module Validatable
module Macros
extend ActiveSupport::Concern
# Validates the size of a collection.
#
# @example
# class Person
# include Mongoid::Document
# has_many :addresses
#
# validates_collec... |
github | locomotivecms/custom_fields | https://github.com/locomotivecms/custom_fields | lib/custom_fields/extensions/mongoid/validatable/collection_size.rb | Ruby | mit | 95 | master | 2,391 | # frozen_string_literal: true
module Mongoid
module Validatable
# Validates that the specified collections do or do not match a certain
# size.
#
# @example Set up the collection size validator.
#
# class Person
# include Mongoid::Document
# has_many :addresses
#
# ... |
github | locomotivecms/custom_fields | https://github.com/locomotivecms/custom_fields | lib/custom_fields/extensions/mongoid/association/relatable.rb | Ruby | mit | 95 | master | 793 | # frozen_string_literal: true
module CustomFieldsRelatableExtension
def resolve_name(mod, name)
super
rescue NameError => e
return name.constantize if name =~ CustomFields::KLASS_REGEXP
raise e
end
def validate!
option = @options.delete(:custom_fields_parent_klass)
super.tap do
@opt... |
github | locomotivecms/custom_fields | https://github.com/locomotivecms/custom_fields | lib/custom_fields/extensions/mongoid/association/referenced/has_many.rb | Ruby | mit | 95 | master | 1,885 | # frozen_string_literal: true
# module Mongoid #:nodoc:
# module Relations #:nodoc:
# module Referenced #:nodoc:
# # This class defines the behaviour for all relations that are a
# # one-to-many between documents in different collections.
# class Many < Relations::Many
# def build_wit... |
github | locomotivecms/custom_fields | https://github.com/locomotivecms/custom_fields | lib/custom_fields/extensions/mongoid/association/referenced/has_one.rb | Ruby | mit | 95 | master | 331 | # frozen_string_literal: true
module CustomFieldsInExtension
module ClassMethods
def valid_options
[:custom_fields_parent_klass] + super
end
end
def self.prepended(base)
class << base
prepend ClassMethods
end
end
end
::Mongoid::Association::Referenced::HasOne.prepend CustomFieldsI... |
github | locomotivecms/custom_fields | https://github.com/locomotivecms/custom_fields | lib/custom_fields/extensions/mongoid/fields/i18n.rb | Ruby | mit | 95 | master | 1,312 | # frozen_string_literal: true
# :nodoc
module Mongoid
# This module defines behaviour for fields.
module Fields
class I18n
attr_accessor :locale, :fallbacks
def self.instance
Thread.current[:mongoid_i18n] ||= Mongoid::Fields::I18n.new
end
def self.locale
instance.loca... |
github | locomotivecms/custom_fields | https://github.com/locomotivecms/custom_fields | lib/custom_fields/extensions/mongoid/fields/localized.rb | Ruby | mit | 95 | master | 1,383 | # frozen_string_literal: true
module Mongoid # :nodoc:
module Fields # :nodoc:
# The behaviour of the Localized fields in the custom fields gem is different
# because we do not rely on I18n directly but on a slight version Mongoid::Fields::I18n.
# The main reason is only practical to handle the following... |
github | locomotivecms/custom_fields | https://github.com/locomotivecms/custom_fields | lib/custom_fields/extensions/mongoid/criteria/queryable/smash.rb | Ruby | mit | 95 | master | 913 | # frozen_string_literal: true
module Mongoid
class Criteria
module Queryable
# This is a smart hash for use with options and selectors.
class Smash < Hash
private
# Get the localized value for the key if needed. If the field uses
# localization the current locale will be appe... |
github | locomotivecms/custom_fields | https://github.com/locomotivecms/custom_fields | lib/custom_fields/types/default.rb | Ruby | mit | 95 | master | 3,573 | # frozen_string_literal: true
module CustomFields
module Types
module Default
module Field
# Build the mongodb updates based on
# the new state of the field
#
# @param [ Hash ] memo Store the updates
#
# @return [ Hash ] The memo object upgraded
#
... |
github | locomotivecms/custom_fields | https://github.com/locomotivecms/custom_fields | lib/custom_fields/types/file.rb | Ruby | mit | 95 | master | 3,504 | # frozen_string_literal: true
module CustomFields
module Types
module File
module Field; end
module Target
extend ActiveSupport::Concern
module ClassMethods
# Adds a file field (using carrierwave)
#
# @param [ Class ] klass The class to modify
... |
github | locomotivecms/custom_fields | https://github.com/locomotivecms/custom_fields | lib/custom_fields/types/relationship_default.rb | Ruby | mit | 95 | master | 782 | # frozen_string_literal: true
module CustomFields
module Types
module RelationshipDefault
module Field
extend ActiveSupport::Concern
included do
field :class_name
field :inverse_of
field :order_by
validates_presence_of :class_name, ... |
github | locomotivecms/custom_fields | https://github.com/locomotivecms/custom_fields | lib/custom_fields/types/money.rb | Ruby | mit | 95 | master | 5,135 | # frozen_string_literal: true
require 'English'
module CustomFields
module Types
module Money
module Field
extend ActiveSupport::Concern
included do
# allow_currency_from_symbol means that the user is able
# to provide another currency instead of the the default
... |
github | locomotivecms/custom_fields | https://github.com/locomotivecms/custom_fields | lib/custom_fields/types/float.rb | Ruby | mit | 95 | master | 1,770 | # frozen_string_literal: true
module CustomFields
module Types
module Float
module Field; end
module Target
extend ActiveSupport::Concern
module ClassMethods
# Add a string field
#
# @param [ Class ] klass The class to modify
# @param [ Hash ]... |
github | locomotivecms/custom_fields | https://github.com/locomotivecms/custom_fields | lib/custom_fields/types/tags.rb | Ruby | mit | 95 | master | 942 | # frozen_string_literal: true
module CustomFields
module Types
module Tags
module Field; end
module Target
extend ActiveSupport::Concern
module ClassMethods
def apply_tags_custom_field(klass, rule)
klass.field rule['name'], localize: rule['localized'] || false,... |
github | locomotivecms/custom_fields | https://github.com/locomotivecms/custom_fields | lib/custom_fields/types/color.rb | Ruby | mit | 95 | master | 1,526 | # frozen_string_literal: true
module CustomFields
module Types
module Color
module Field; end
module Target
extend ActiveSupport::Concern
module ClassMethods
# Add a color field
#
# @param [ Class ] klass The class to modify
# @param [ Hash ] ... |
github | locomotivecms/custom_fields | https://github.com/locomotivecms/custom_fields | lib/custom_fields/types/password.rb | Ruby | mit | 95 | master | 2,995 | # frozen_string_literal: true
module CustomFields
module Types
module Password
module Field
MIN_PASSWORD_LENGTH = 6
end
module Target
extend ActiveSupport::Concern
module ClassMethods
# Add a password field
#
# @param [ Class ] klass The c... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.