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 | app/models/additional_exam_score.rb | Ruby | apache-2.0 | 95 | master | 767 | class AdditionalExamScore < ActiveRecord::Base
belongs_to :student
belongs_to :additional_exam
belongs_to :grading_level
before_save :calculate_grade
private
def calculate_grade
additional_exam = self.additional_exam
additional_exam_group = additional_exam.additional_exam_group
additional_ex... |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | app/models/archived_guardian.rb | Ruby | apache-2.0 | 95 | master | 251 | class ArchivedGuardian < ActiveRecord::Base
belongs_to :country
belongs_to :ward, :class_name => 'ArchivedStudent'
def full_name
"#{first_name} #{last_name}"
end
def is_immediate_contact?
ward.immediate_contact_id == id
end
end |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | app/models/user_notifier.rb | Ruby | apache-2.0 | 95 | master | 451 | class UserNotifier < ActionMailer::Base
def forgot_password(user)
setup_email(user)
@subject += 'Reset Password'
@body[:url] = "http://demo.projectfedena.org/user/reset_password/#{user.reset_password_code}"
end
protected
def setup_email(user)
@recipients = "#{user.email}"
@from ... |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | app/models/course.rb | Ruby | apache-2.0 | 95 | master | 1,057 | class Course < ActiveRecord::Base
validates_presence_of :course_name, :code
validate :presence_of_initial_batch, :on => :create
has_many :batches
accepts_nested_attributes_for :batches
named_scope :active, :conditions => { :is_deleted => false }, :order => 'course_name asc'
named_scope :deleted, :conditio... |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | app/models/news.rb | Ruby | apache-2.0 | 95 | master | 264 | class News < ActiveRecord::Base
belongs_to :author, :class_name => 'User'
has_many :comments, :class_name => 'NewsComment'
validates_presence_of :title, :content
default_scope :order => 'created_at DESC'
cattr_reader :per_page
@@per_page = 12
end |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | app/models/configuration.rb | Ruby | apache-2.0 | 95 | master | 1,505 | class Configuration < ActiveRecord::Base
EXAM_RESULT_TYPE_OPTIONS = ['Marks', 'Grades', 'MarksAndGrades']
STUDENT_ATTENDANCE_TYPE_OPTIONS = ['Daily', 'SubjectWise']
class << self
def get_config_value(key)
c = find_by_config_key(key)
c.nil? ? nil : c.config_value
end
def save_i... |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | app/models/student_category.rb | Ruby | apache-2.0 | 95 | master | 360 | class StudentCategory < ActiveRecord::Base
has_many :students
has_many :fee_category ,:class_name =>"FinanceFeeCategory"
validates_presence_of :name
validates_uniqueness_of :name,:case_sensitive => false
def before_destroy
students = Student.find_all_by_student_category_id self
students.each { |s| ... |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | app/models/additional_exam_group.rb | Ruby | apache-2.0 | 95 | master | 603 | class AdditionalExamGroup < ActiveRecord::Base
validates_presence_of :name
validates_presence_of :students_list
belongs_to :batch
has_many :additional_exams
accepts_nested_attributes_for :additional_exams
attr_accessor :maximum_marks, :minimum_marks, :weightage
def before_save
self.exam_date = self... |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | app/models/elective_group.rb | Ruby | apache-2.0 | 95 | master | 305 | class ElectiveGroup < ActiveRecord::Base
belongs_to :batch
belongs_to :subject
has_many :subject
validates_presence_of :name
named_scope :for_batch, lambda { |b| { :conditions => { :batch_id => b, :is_deleted => false } } }
def inactivate
update_attribute(:is_deleted, false)
end
end |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | app/models/subject.rb | Ruby | apache-2.0 | 95 | master | 458 | class Subject < ActiveRecord::Base
belongs_to :batch
belongs_to :elective_group
validates_presence_of :name, :max_weekly_classes, :code
validates_numericality_of :max_weekly_classes
named_scope :for_batch, lambda { |b| { :conditions => { :batch_id => b.to_i, :is_deleted => false } } }
named_scope :withou... |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | app/models/news_comment.rb | Ruby | apache-2.0 | 95 | master | 205 | class NewsComment < ActiveRecord::Base
belongs_to :news
belongs_to :author, :class_name => 'User'
validates_presence_of :content
validates_presence_of :author
validates_presence_of :news_id
end |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | app/models/weekday.rb | Ruby | apache-2.0 | 95 | master | 247 | class Weekday < ActiveRecord::Base
belongs_to :batch
default_scope :order => 'weekday asc'
named_scope :default, :conditions => { :batch_id => nil}
named_scope :for_batch, lambda { |b| { :conditions => { :batch_id => b.to_i } } }
end |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | app/models/exam_group.rb | Ruby | apache-2.0 | 95 | master | 3,153 | class ExamGroup < ActiveRecord::Base
validates_presence_of :name
belongs_to :batch
belongs_to :grouped_exam
has_many :exams
accepts_nested_attributes_for :exams
attr_accessor :maximum_marks, :minimum_marks, :weightage
def before_save
self.exam_date = self.exam_date || Date.today
end
def ba... |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | app/models/class_timing.rb | Ruby | apache-2.0 | 95 | master | 476 | class ClassTiming < ActiveRecord::Base
has_many :timetable_entries
belongs_to :batch
validates_presence_of :name
named_scope :for_batch, lambda { |b| { :conditions => { :batch_id => b.to_i } } }
named_scope :default, :conditions => { :batch_id => nil, :is_break => false }
def validate
errors.add(:e... |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | app/models/archived_exam_score.rb | Ruby | apache-2.0 | 95 | master | 2,312 | class ArchivedExamScore < ActiveRecord::Base
belongs_to :student
belongs_to :exam
belongs_to :grading_level
before_save :calculate_grade
def calculate_percentage
percentage = self.marks.to_i * 100 / self.exam.maximum_marks
end
def grouped_exam_subject_total(subject,student,type,batch = "")
if ... |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | app/models/student.rb | Ruby | apache-2.0 | 95 | master | 4,630 | class Student < ActiveRecord::Base
belongs_to :country
belongs_to :batch
belongs_to :student_category
belongs_to :nationality, :class_name => 'Country'
has_one :immediate_contact
has_one :student_previous_data
has_many :student_previous_subject_mark
has_many :guardians, :foreign_key => 'ward_i... |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | app/models/event.rb | Ruby | apache-2.0 | 95 | master | 391 | class Event < ActiveRecord::Base
validates_presence_of :title, :description
named_scope :holidays, :conditions => {:is_holiday => true}
named_scope :exams, :conditions => {:is_exam => true}
class << self
def is_a_holiday?(day)
return true if Event.holidays.count(:all, :conditions => ["start_date <=?... |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | app/models/user.rb | Ruby | apache-2.0 | 95 | master | 2,343 | class User < ActiveRecord::Base
attr_accessor :password, :role, :old_password, :new_password, :confirm_password
validates_uniqueness_of :username, :email
validates_length_of :username, :within => 1..20
validates_length_of :password, :within => 4..40, :allow_nil => true
validates_format_of :userna... |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | app/models/exam.rb | Ruby | apache-2.0 | 95 | master | 2,006 | class Exam < ActiveRecord::Base
# validates_presence_of :maximum_marks
# validates_presence_of :minimum_marks
validates_presence_of :start_time
validates_presence_of :end_time
belongs_to :exam_group
belongs_to :subject, :conditions => { :is_deleted => false }
belongs_to :event
has_many :exam_scores
... |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | app/models/additional_exam.rb | Ruby | apache-2.0 | 95 | master | 1,511 | class AdditionalExam < ActiveRecord::Base
validates_presence_of :start_time
validates_presence_of :end_time
belongs_to :additional_exam_group
belongs_to :subject
belongs_to :event
has_many :additional_exam_scores
accepts_nested_attributes_for :additional_exam_scores
def validate
errors.add(... |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | app/models/sms_setting.rb | Ruby | apache-2.0 | 95 | master | 1,125 | class SmsSetting < ActiveRecord::Base
def application_sms_active
application_sms = SmsSetting.find_by_settings_key("ApplicationEnabled")
return true if application_sms.is_enabled
end
def student_sms_active
student_sms = SmsSetting.find_by_settings_key("StudentSmsEnabled")
return true if student_... |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | app/models/fedena_mailer.rb | Ruby | apache-2.0 | 95 | master | 257 | class FedenaMailer < ActionMailer::Base
def email(sender,recipients, subject, message)
@bcc = recipients
@recipients = 'noreply@fedena.com'
@from = sender
@subject = subject
@sent_on = Time.now
@body['message'] = message
end
end |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | app/models/archived_student.rb | Ruby | apache-2.0 | 95 | master | 1,318 | class ArchivedStudent < ActiveRecord::Base
belongs_to :country
belongs_to :batch
belongs_to :student_category
belongs_to :nationality, :class_name => 'Country'
has_many :archived_guardians, :foreign_key => 'ward_id', :dependent => :destroy
has_one :immediate_contact
#has_and_belongs_to_many :graduated_ba... |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | app/models/archived_employee.rb | Ruby | apache-2.0 | 95 | master | 637 | class ArchivedEmployee < ActiveRecord::Base
belongs_to :employee_category
belongs_to :employee_position
belongs_to :employee_grade
belongs_to :employee_department
belongs_to :nationality, :class_name => 'Country'
has_many :archived_employee_bank_details
has_many :archived_employee_additional_de... |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | app/models/students_subject.rb | Ruby | apache-2.0 | 95 | master | 209 | class StudentsSubject < ActiveRecord::Base
belongs_to :student
belongs_to :subject
def student_assigned(student,subject)
StudentsSubject.find_by_student_id_and_subject_id(student,subject)
end
end |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | app/models/xml.rb | Ruby | apache-2.0 | 95 | master | 649 | class Xml < ActiveRecord::Base
class << self
def get_ledger_name(key)
c = find_by_finance_name(key)
c.nil? ? nil : c.ledger_name
end
def set_value(key, value)
@xml = find_by_finance_name(key)
@xml.nil? ?
Xml.create(:finance_name => key, :ledger_name => value) :
@xml.upda... |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | app/models/finance/finance_fee_collection.rb | Ruby | apache-2.0 | 95 | master | 1,006 | class FinanceFeeCollection < ActiveRecord::Base
belongs_to :batch
has_many :finance_fees
belongs_to :fee_category,:class_name => "FinanceFeeCategory"
validates_presence_of :name,:start_date,:fee_category_id,:end_date,:due_date
def full_name
"#{name} - #{start_date.to_s}"
end
def fee_transactions(st... |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | app/models/finance/finance_transaction_trigger.rb | Ruby | apache-2.0 | 95 | master | 212 | class FinanceTransactionTrigger < ActiveRecord::Base
belongs_to :finance_category, :class_name => "FinanceTransactionCategory", :foreign_key => 'finance_category_id'
validates_numericality_of :percentage
end |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | app/models/finance/finance_fee.rb | Ruby | apache-2.0 | 95 | master | 379 | class FinanceFee < ActiveRecord::Base
belongs_to :finance_fee_collection
belongs_to :transaction, :class_name => 'FinanceTransaction'
has_many :components, :class_name => 'FinanceFeeComponent', :foreign_key => 'fee_id'
belongs_to :student
def check_transaction_done
unless self.transaction_id.nil?
... |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | app/models/finance/finance_fee_category.rb | Ruby | apache-2.0 | 95 | master | 1,238 | class FinanceFeeCategory < ActiveRecord::Base
belongs_to :batch
belongs_to :student
has_many :fee_particulars, :class_name => "FinanceFeeParticulars"
has_many :fee_collections, :class_name => "FinanceFeeCollection"
cattr_reader :per_page
validates_presence_of :name
def fees(student)
FinanceF... |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | app/models/finance/finance_transaction_category.rb | Ruby | apache-2.0 | 95 | master | 739 | class FinanceTransactionCategory < ActiveRecord::Base
has_many :finance_transactions
has_one :trigger, :class_name => "FinanceTransactionTrigger", :foreign_key => "category_id"
validates_presence_of :name
named_scope :expense_categories, :conditions => "is_income = false AND name NOT LIKE 'Salary'"
named_... |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | app/models/finance/finance_transaction.rb | Ruby | apache-2.0 | 95 | master | 3,188 | class FinanceTransaction < ActiveRecord::Base
belongs_to :category, :class_name => 'FinanceTransactionCategory', :foreign_key => 'category_id'
belongs_to :student
cattr_reader :per_page
validates_presence_of :title,:amount
validates_numericality_of :amount
def self.report(start_date,end_date,page)
pagi... |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | app/models/finance/finance_donation.rb | Ruby | apache-2.0 | 95 | master | 498 | class FinanceDonation < ActiveRecord::Base
belongs_to :transaction, :class_name => 'FinanceTransaction'
validates_presence_of :donor, :amount
before_save :create_finance_transaction
def create_finance_transaction
transaction = FinanceTransaction.create(
:title => "Donation from " + donor,
:des... |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | app/models/finance/finance_fee_particulars.rb | Ruby | apache-2.0 | 95 | master | 273 | class FinanceFeeParticulars < ActiveRecord::Base
belongs_to :fee_category ,:class_name => "FinanceFeeCategory"
belongs_to :student_category
validates_presence_of :name,:amount
validates_numericality_of :amount
cattr_reader :per_page
@@per_page = 10
end |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | app/models/finance/finance_fee_structure_element.rb | Ruby | apache-2.0 | 95 | master | 4,076 | class FinanceFeeStructureElement < ActiveRecord::Base
# t.decimal :amount, :precision => 8, :scale => 2
# t.string :label
# t.references :batch
# t.references :student_category
# t.references :student
# t.references :finance_fee
# t.references :parent
# t.references :fee_collection
... |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | app/models/hr/employee_additional_detail.rb | Ruby | apache-2.0 | 95 | master | 430 | class EmployeeAdditionalDetail < ActiveRecord::Base
belongs_to :employee
belongs_to :additional_field
def archive_employee_additional_detail(archived_employee)
additional_detail_attributes = self.attributes
additional_detail_attributes.delete "id"
additional_detail_attributes["employee_id"] = archive... |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | app/models/hr/employee_salary_structure.rb | Ruby | apache-2.0 | 95 | master | 424 | class EmployeeSalaryStructure < ActiveRecord::Base
has_many :payroll_categories
belongs_to :employee
def archive_employee_salary_structure(archived_employee)
salary_structure_attributes = self.attributes
salary_structure_attributes.delete "id"
salary_structure_attributes["employee_id"] = archived_emp... |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | app/models/hr/monthly_payslip.rb | Ruby | apache-2.0 | 95 | master | 320 | class MonthlyPayslip < ActiveRecord::Base
validates_presence_of :salary_date
belongs_to :payroll_category
belongs_to :approver ,:class_name => 'User'
def approve(user_id)
self.is_approved = true
self.approver_id = user_id
self.save
end
def payslip_count(start_date,end_date)
end
end |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | app/models/hr/employee_category.rb | Ruby | apache-2.0 | 95 | master | 200 | class EmployeeCategory < ActiveRecord::Base
validates_presence_of :name, :prefix
validates_uniqueness_of :name, :prefix
has_many :employee_positions
belongs_to :employee_salary_structure
end |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | app/models/hr/employee.rb | Ruby | apache-2.0 | 95 | master | 5,485 | class Employee < ActiveRecord::Base
belongs_to :employee_category
belongs_to :employee_position
belongs_to :employee_grade
belongs_to :employee_department
belongs_to :nationality, :class_name => 'Country'
has_and_belongs_to_many :subjects
has_many :timetable_entries
has_many :employee_bank_de... |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | app/models/hr/employee_bank_detail.rb | Ruby | apache-2.0 | 95 | master | 382 | class EmployeeBankDetail < ActiveRecord::Base
belongs_to :employee
belongs_to :bank_field
def archive_employee_bank_detail(archived_employee)
bank_detail_attributes = self.attributes
bank_detail_attributes.delete "id"
bank_detail_attributes["employee_id"] = archived_employee
self.delete if Archiv... |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | app/models/hr/employee_department.rb | Ruby | apache-2.0 | 95 | master | 420 | class EmployeeDepartment < ActiveRecord::Base
validates_presence_of :name
validates_uniqueness_of :name, :code
has_many :employees
def department_total_salary(start_date,end_date)
total = 0
self.employees.each do |e|
salary_dates = e.all_salaries(start_date,end_date)
salary_dates.each do |... |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | app/helpers/application_helper.rb | Ruby | apache-2.0 | 95 | master | 1,044 | module ApplicationHelper
def get_stylesheets
stylesheets = [] unless stylesheets
["#{controller.controller_path}/#{controller.action_name}"].each do |ss|
stylesheets << ss
end
end
def observe_fields(fields, options)
with = "" #prepare a value of the :with parameter
... |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | app/controllers/additional_exam_groups_controller.rb | Ruby | apache-2.0 | 95 | master | 1,770 | class AdditionalExamGroupsController < ApplicationController
before_filter :initial_queries
filter_access_to :all
in_place_edit_for :additional_exam_group, :name
in_place_edit_for :additional_exam, :maximum_marks
in_place_edit_for :additional_exam, :minimum_marks
in_place_edit_for :additional_exam, :weigh... |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | app/controllers/sms_settings_controller.rb | Ruby | apache-2.0 | 95 | master | 2,650 | class SmsSettingsController < ApplicationController
filter_access_to :all
def index
@config = Configuration.available_modules
unless @config.include?('SMS')
redirect_to :controller=>"user" , :action=>"dashboard"
else
@application_sms_enabled = SmsSetting.find_by_settings_key("ApplicationE... |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | app/controllers/archived_student_controller.rb | Ruby | apache-2.0 | 95 | master | 12,280 | class ArchivedStudentController < ApplicationController
filter_access_to :all
def profile
@current_user = current_user
@archived_student = ArchivedStudent.find(params[:id])
end
def guardians
@archived_student = ArchivedStudent.find(params[:id])
@parents = ArchivedGuardian.find(:all, :condition... |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | app/controllers/exam_groups_controller.rb | Ruby | apache-2.0 | 95 | master | 1,340 | class ExamGroupsController < ApplicationController
before_filter :initial_queries
filter_access_to :all
in_place_edit_for :exam_group, :name
in_place_edit_for :exam, :maximum_marks
in_place_edit_for :exam, :minimum_marks
in_place_edit_for :exam, :weightage
def index
@exam_groups = @batch.exam_groups... |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | app/controllers/attendance_reports_controller.rb | Ruby | apache-2.0 | 95 | master | 5,237 | class AttendanceReportsController < ApplicationController
before_filter :login_required
filter_access_to :all
def index
@batches = Batch.active
@config = Configuration.find_by_config_key('StudentAttendanceType')
end
def subject
@batch = Batch.find params[:batch_id]
@subjects = Subject.find_a... |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | app/controllers/grading_levels_controller.rb | Ruby | apache-2.0 | 95 | master | 2,427 | class GradingLevelsController < ApplicationController
before_filter :login_required
filter_access_to :all
def index
@batches = Batch.active
@grading_levels = GradingLevel.default
end
def new
@grading_level = GradingLevel.new
@batch = Batch.find params[:id] if request.xhr? and params[:id]
... |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | app/controllers/configuration_controller.rb | Ruby | apache-2.0 | 95 | master | 1,293 | class ConfigurationController < ApplicationController
before_filter :login_required
filter_access_to :all
FILE_EXTENSIONS = [".jpg",".jpeg",".png"]#,".gif",".png"]
FILE_MAXIMUM_SIZE_FOR_FILE=1048576
def settings
@config = Configuration.get_multiple_configs_as_hash ['InstitutionName', 'InstitutionAddress... |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | app/controllers/user_controller.rb | Ruby | apache-2.0 | 95 | master | 10,421 | class UserController < ApplicationController
layout :choose_layout
before_filter :login_required, :except => [:forgot_password, :login, :set_new_password, :reset_password]
before_filter :only_admin_allowed, :only => [:edit, :create, :index, :edit_privilege]
# filter_access_to :edit_privilege
def choose_layout
... |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | app/controllers/batch_transfers_controller.rb | Ruby | apache-2.0 | 95 | master | 8,078 | class BatchTransfersController < ApplicationController
before_filter :login_required
filter_access_to :all
def index
@batches = Batch.active
end
def show
@batch = Batch.find params[:id], :include => [:students]
@batches = Batch.active - @batch.to_a
end
def transfer
unless params[:tra... |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | app/controllers/reminder_controller.rb | Ruby | apache-2.0 | 95 | master | 6,446 | class ReminderController < ApplicationController
before_filter :login_required
before_filter :protect_view_reminders, :only=>[:view_reminder,:mark_unread,:delete_reminder_by_recipient]
before_filter :protect_sent_reminders, :only=>[:view_sent_reminder,:delete_reminder_by_sender]
def index
@user = current_u... |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | app/controllers/calendar_controller.rb | Ruby | apache-2.0 | 95 | master | 19,648 | class CalendarController < ApplicationController
before_filter :login_required
def index
@user = current_user
if params[:new_month].nil?
@show_month = Date.today
else
d = params[:new_month].to_i
passed_date = (params[:passed_date]).to_date
if params[:new_month].to_i > passed_date... |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | app/controllers/timetable_controller.rb | Ruby | apache-2.0 | 95 | master | 15,763 | class TimetableController < ApplicationController
before_filter :login_required
before_filter :protect_other_student_data
filter_access_to :all
def generate
@batches = Batch.active
if request.post?
@batch = Batch.find params[:timetable][:batch_id]
@config = Configuration.find_by_config_ke... |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | app/controllers/batches_controller.rb | Ruby | apache-2.0 | 95 | master | 1,419 | class BatchesController < ApplicationController
before_filter :init_data
filter_access_to :all
def index
@batches = @course.batches
end
def new
@batch = @course.batches.build
end
def create
@batch = @course.batches.build(params[:batch])
if @batch.save
flash[:notice] = 'Batch cre... |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | app/controllers/exam_controller.rb | Ruby | apache-2.0 | 95 | master | 20,222 | class ExamController < ApplicationController
before_filter :login_required
before_filter :protect_other_student_data
filter_access_to :all
def index
end
def update_exam_form
@batch = Batch.find(params[:batch])
@name = params[:exam_option][:name]
@type = params[:exam_option][:exam_type]
unl... |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | app/controllers/exams_controller.rb | Ruby | apache-2.0 | 95 | master | 2,674 | class ExamsController < ApplicationController
before_filter :query_data
filter_access_to :all
def new
@exam = Exam.new
@subjects = @batch.subjects
end
def create
@exam = Exam.new(params[:exam])
@exam.exam_group_id = @exam_group.id
if @exam.save
flash[:notice] = "New exam created suc... |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | app/controllers/news_controller.rb | Ruby | apache-2.0 | 95 | master | 1,747 | class NewsController < ApplicationController
before_filter :login_required
filter_access_to :all
def add
@news = News.new(params[:news])
@news.author = current_user
if request.post? and @news.save
sms_setting = SmsSetting.new()
if sms_setting.application_sms_active
students = Stud... |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | app/controllers/employee_attendances_controller.rb | Ruby | apache-2.0 | 95 | master | 2,246 | class EmployeeAttendancesController < ApplicationController
before_filter :login_required,:configuration_settings_for_hr
filter_access_to :all
def index
@departments = EmployeeDepartment.find(:all, :conditions=>"status = true", :order=> "name ASC")
end
def show
@dept = EmployeeDepartment.find(para... |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | app/controllers/finance_controller.rb | Ruby | apache-2.0 | 95 | master | 54,120 | class FinanceController < ApplicationController
before_filter :login_required,:configuration_settings_for_finance
filter_access_to :all
def index
@hr = Configuration.find_by_config_value("HR")
end
def automatic_transactions
@triggers = FinanceTransactionTrigger.all
@categories = FinanceTransact... |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | app/controllers/weekday_controller.rb | Ruby | apache-2.0 | 95 | master | 1,284 | class WeekdayController < ApplicationController
before_filter :login_required
filter_access_to :all
def index
@batches = Batch.active
@weekdays = Weekday.default
@day = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]
@days = ["0", "1", "2", "3", "4", "5", "6"]
end
... |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | app/controllers/payroll_controller.rb | Ruby | apache-2.0 | 95 | master | 4,334 | class PayrollController < ApplicationController
before_filter :login_required
filter_access_to :all
def add_category
@categories = PayrollCategory.find_all_by_is_deduction(false, :order=> "name ASC")
@deductionable_categories = PayrollCategory.find_all_by_is_deduction(true, :order=> "name ASC")
@cate... |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | app/controllers/employee_attendance_controller.rb | Ruby | apache-2.0 | 95 | master | 9,464 | class EmployeeAttendanceController < ApplicationController
before_filter :login_required,:configuration_settings_for_hr
before_filter :protect_leave_dashboard, :only => [:leaves, :employee_attendance_pdf]
before_filter :protect_applied_leave, :only => [:own_leave_application, :cancel_application]
before_filter ... |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | app/controllers/archived_employee_controller.rb | Ruby | apache-2.0 | 95 | master | 4,527 | class ArchivedEmployeeController < ApplicationController
before_filter :login_required,:configuration_settings_for_hr
#filter_access_to :all
prawnto :prawn => {:left_margin => 25, :right_margin => 25}
def profile
@current_user = current_user
@employee = ArchivedEmployee.find(params[:id])
@new_... |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | app/controllers/class_timings_controller.rb | Ruby | apache-2.0 | 95 | master | 2,314 | class ClassTimingsController < ApplicationController
before_filter :login_required
filter_access_to :all
def index
@batches = Batch.active
@class_timings = ClassTiming.default
end
def new
@class_timing = ClassTiming.new
@batch = Batch.find params[:id] if request.xhr? and params[:id]
resp... |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | app/controllers/courses_controller.rb | Ruby | apache-2.0 | 95 | master | 2,676 | class CoursesController < ApplicationController
before_filter :login_required
before_filter :find_course, :only => [:show, :edit, :update, :destroy]
filter_access_to :all
def index
@courses = Course.active
end
def new
@course = Course.new
end
def manage_course
@courses = Course.active
... |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | app/controllers/employee_controller.rb | Ruby | apache-2.0 | 95 | master | 55,477 | class EmployeeController < ApplicationController
before_filter :login_required,:configuration_settings_for_hr
filter_access_to :all
before_filter :protect_other_employee_data, :only => [:individual_payslip_pdf]
prawnto :prawn => {:left_margin => 25, :right_margin => 25}
def add_category
@categories = E... |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | app/controllers/subjects_controller.rb | Ruby | apache-2.0 | 95 | master | 2,200 | class SubjectsController < ApplicationController
before_filter :login_required
filter_access_to :all
def index
@batches = Batch.active
end
def new
@subject = Subject.new
@batch = Batch.find params[:id] if request.xhr? and params[:id]
@elective_group = ElectiveGroup.find params[:id2] unless pa... |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | app/controllers/application_controller.rb | Ruby | apache-2.0 | 95 | master | 4,459 | class ApplicationController < ActionController::Base
helper :all
protect_from_forgery # :secret => '434571160a81b5595319c859d32060c1'
filter_parameter_logging :password
before_filter { |c| Authorization.current_user = c.current_user }
before_filter :message_user
#before_filter :set_user_language
d... |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | app/controllers/elective_groups_controller.rb | Ruby | apache-2.0 | 95 | master | 1,280 | class ElectiveGroupsController < ApplicationController
before_filter :pre_load_objects
def index
@elective_groups = ElectiveGroup.for_batch(@batch.id, :include => :subjects)
end
def new
@elective_group = @batch.elective_groups.build
end
def create
@elective_group = ElectiveGroup.new(params[:e... |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | app/controllers/additional_exam_controller.rb | Ruby | apache-2.0 | 95 | master | 5,118 | class AdditionalExamController < ApplicationController
before_filter :login_required
filter_access_to :all
def index
end
def update_exam_form
@batch = Batch.find(params[:batch])
@name = params[:exam_option][:name]
@type = params[:exam_option][:exam_type]
unless @name == ''
@additional_... |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | app/controllers/student_attendance_controller.rb | Ruby | apache-2.0 | 95 | master | 2,955 | class StudentAttendanceController < ApplicationController
before_filter :login_required
# before_filter :protect_other_student_data
def index
end
def student
@config = Configuration.find_by_config_key('StudentAttendanceType')
@student = Student.find(params[:id])
@batch = Batch.find(@student.bat... |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | app/controllers/event_controller.rb | Ruby | apache-2.0 | 95 | master | 9,316 | class EventController < ApplicationController
before_filter :login_required
filter_access_to :all
def index
@events = Event.new(params[:events])
if params[:id].nil?
@date = Time.now
else
date = params[:id].to_date
@date = date.to_time
end
if request.post? and @events.save
... |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | app/controllers/student_controller.rb | Ruby | apache-2.0 | 95 | master | 36,599 | class StudentController < ApplicationController
filter_access_to :all
before_filter :login_required
before_filter :protect_other_student_data, :except =>[:show]
before_filter :find_student, :only => [
:academic_report, :academic_report_all, :admission3, :change_to_former,
:delete, :edit, :add_guardia... |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | app/controllers/additional_exams_controller.rb | Ruby | apache-2.0 | 95 | master | 3,402 | class AdditionalExamsController < ApplicationController
before_filter :query_data
filter_access_to :all
def show
@additional_exam = AdditionalExam.find params[:id], :include => :additional_exam_group
additional_exam_subject = Subject.find(@additional_exam.subject_id)
@students = @additional_exam.add... |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | app/controllers/attendances_controller.rb | Ruby | apache-2.0 | 95 | master | 4,983 | class AttendancesController < ApplicationController
filter_access_to :all
def index
@batches = Batch.active
@config = Configuration.find_by_config_key('StudentAttendanceType')
end
def list_subject
@batch = Batch.find(params[:batch_id])
@subjects = @batch.subjects
render(:update) do |page|
... |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | app/controllers/xml_controller.rb | Ruby | apache-2.0 | 95 | master | 23,511 | class XmlController < ApplicationController
require "rexml/document"
before_filter :login_required
filter_access_to :all
def index
end
def settings
@xml = Xml.get_multiple_finance_as_hash ['Salary', 'Fee', 'Donation']
if request.post?
Xml.set_ledger_name(params[:xml_settings])
f... |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | app/controllers/examination_result_controller.rb | Ruby | apache-2.0 | 95 | master | 14,048 | class ExaminationResultController < ApplicationController
# before_filter :login_required
# filter_access_to :all
#
# def add
# @courses = AcademicYear.this.courses
# @course1 = @courses[0] unless @courses.nil?
# @subjects = []
# @exams = []
# end
#
# def add_results
# @e_id = params[:examination_re... |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | app/controllers/sms_controller.rb | Ruby | apache-2.0 | 95 | master | 9,154 | class SmsController < ApplicationController
filter_access_to :all
def index
@config = Configuration.available_modules
unless @config.include?('SMS')
redirect_to :controller=>"user" , :action=>"dashboard"
else
@sms_setting = SmsSetting.new()
end
end
def settings
@config = Conf... |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | config/authorization_rules.rb | Ruby | apache-2.0 | 95 | master | 41,921 | authorization do
#custom - privileges
role :examination_control do
has_permission_on [:exam],
:to => [
:index,
:create_exam,
:update_batch,
:create_examtype,
:create,:create_grading,
:delete,
:delete_examtype,
:delete_grading,
:edit,... |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | config/environment.rb | Ruby | apache-2.0 | 95 | master | 477 | require File.join(File.dirname(__FILE__), 'boot')
RAILS_GEM_VERSION = '2.3.5' unless defined? RAILS_GEM_VERSION
Rails::Initializer.run do |config|
config.time_zone = 'UTC'
config.gem 'declarative_authorization', :source => 'http://gemcutter.org'
config.gem 'searchlogic'
config.gem 'prawn', :version=> '0.6.3... |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | config/routes.rb | Ruby | apache-2.0 | 95 | master | 1,133 | ActionController::Routing::Routes.draw do |map|
map.resources :grading_levels
map.resources :class_timings
map.resources :subjects
map.resources :attendances
map.resources :employee_attendances
map.resources :attendance_reports
map.feed 'courses/manage_course', :controller => 'courses' ,:action=>'manage... |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | config/boot.rb | Ruby | apache-2.0 | 95 | master | 2,694 | RAILS_ROOT = "#{File.dirname(__FILE__)}/.." unless defined?(RAILS_ROOT)
module Rails
class << self
def boot!
unless booted?
preinitialize
pick_boot.run
end
end
def booted?
defined? Rails::Initializer
end
def pick_boot
(vendor_rails? ? VendorBoot : GemBoot... |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | config/initializers/session_store.rb | Ruby | apache-2.0 | 95 | master | 799 | # Be sure to restart your server when you modify this file.
# Your secret key for verifying cookie session data integrity.
# If you change this key, all old sessions will become invalid!
# Make sure the secret is at least 30 characters and all random,
# no regular words or you'll be exposed to dictionary attacks.
Act... |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | config/environments/test.rb | Ruby | apache-2.0 | 95 | master | 1,657 | # Settings specified here will take precedence over those in config/environment.rb
# The test environment is used exclusively to run your application's
# test suite. You never need to work with it otherwise. Remember that
# your test database is "scratch space" for the test suite and is wiped
# and recreated between... |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | config/environments/development.rb | Ruby | apache-2.0 | 95 | master | 1,096 | # Settings specified here will take precedence over those in config/environment.rb
# In the development environment your application's code is reloaded on
# every request. This slows down response time but is perfect for development
# since you don't have to restart the webserver when you make code changes.
config.ca... |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | config/environments/cucumber.rb | Ruby | apache-2.0 | 95 | master | 1,385 | # Edit at your own peril - it's recommended to regenerate this file
# in the future when you upgrade to a newer version of Cucumber.
# IMPORTANT: Setting config.cache_classes to false is known to
# break Cucumber's use_transactional_fixtures method.
# For more information see https://rspec.lighthouseapp.com/projects/1... |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | lib/sms_manager.rb | Ruby | apache-2.0 | 95 | master | 1,129 | # Configure your SMS API settings
require 'net/http'
class SmsManager
attr_accessor :recipients, :message
SMS_URL = '' # API URL
USERNAME = ''
PASSWORD = ''
SENDERNAME = ''
def initialize(message, recipients)
@recipients = recipients
@message = CGI::escape message
end
def send_sms
reque... |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | lib/tasks/reek.rake | Ruby | apache-2.0 | 95 | master | 1,235 | desc "Will generate Reek output for each Ruby file in RAILS_ROOT."
task(:reek) do
require 'find'
require 'fileutils'
reek_dir_name = "reek"
reek_dir = "#{RAILS_ROOT}/public/#{reek_dir_name}"
index_file = "#{reek_dir}/index.html"
output_files = {}
unless File.exists?(reek_dir) && File.directory?(reek_dir)... |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | lib/tasks/load_csv_task.rake | Ruby | apache-2.0 | 95 | master | 1,206 | namespace :db do
desc "load user data from csv"
task :load_csv_task => :environment do
require 'fastercsv'
FasterCSV.foreach("excel.csv") do |row|
s = Student.new(
:admission_no => row[0],
:roll_no => row[1], # class roll no.
:admission_date => row[2],
:first_... |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | db/schema.rb | Ruby | apache-2.0 | 95 | master | 23,469 | # This file is auto-generated from the current state of the database. Instead of editing this file,
# please use the migrations feature of Active Record to incrementally modify your database, and
# then regenerate this schema definition.
#
# Note that this schema.rb definition is the authoritative source for your data... |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | db/seeds.rb | Ruby | apache-2.0 | 95 | master | 6,152 | StudentCategory.destroy_all
StudentCategory.create([
{:name=>"OBC",:is_deleted=>false},
{:name=>"General",:is_deleted=>false}
])
#HR modules defaults
#EmployeeCategory.delete_all
EmployeeCategory.create([
# {:name => 'Fedena Admin',:prefix => 'Admin',:status => true},
{:name => 'Management',:prefix => 'MGMT'... |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | db/migrate/20100429093616_create_period_entries.rb | Ruby | apache-2.0 | 95 | master | 325 | class CreatePeriodEntries < ActiveRecord::Migration
def self.up
create_table :period_entries do |t|
t.date :month_date
t.references :batch
t.references :subject
t.references :class_timing
t.references :employee
end
end
def self.down
drop_table :period_entries
end... |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | db/migrate/20100730092747_create_archived_exam_scores.rb | Ruby | apache-2.0 | 95 | master | 415 | class CreateArchivedExamScores < ActiveRecord::Migration
def self.up
create_table :archived_exam_scores do |t|
t.references :student
t.references :exam
t.decimal :marks, :precision => 7, :scale => 2
t.references :grading_level
t.string :remarks
t.boolean :is_failed
... |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | db/migrate/20100525055716_students_subject.rb | Ruby | apache-2.0 | 95 | master | 262 | class StudentsSubject < ActiveRecord::Migration
def self.up
create_table :students_subjects do |t|
t.references :student
t.references :subject
t.references :batch
end
end
def self.down
drop_table :students_subjects
end
end |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | db/migrate/20090622104054_create_archived_students.rb | Ruby | apache-2.0 | 95 | master | 1,330 | class CreateArchivedStudents < ActiveRecord::Migration
def self.up
create_table :archived_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.ref... |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | db/migrate/20090914095002_create_payroll_categories.rb | Ruby | apache-2.0 | 95 | master | 329 | class CreatePayrollCategories < ActiveRecord::Migration
def self.up
create_table :payroll_categories do |t|
t.string :name
t.float :percentage
t.references :payroll_category
t.boolean :is_deduction
t.boolean :status
end
end
def self.down
drop_table :payroll_categories
... |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | db/migrate/20091009093746_create_individual_payslip_categories.rb | Ruby | apache-2.0 | 95 | master | 408 | class CreateIndividualPayslipCategories < ActiveRecord::Migration
def self.up
create_table :individual_payslip_categories do |t|
t.references :employee
t.date :salary_date
t.string :name
t.string :amount
t.boolean :is_deduction
t.boolean :include_every_month... |
github | projectfedena/projectfedena_v2.0 | https://github.com/projectfedena/projectfedena_v2.0 | db/migrate/20090718052749_create_exam_scores.rb | Ruby | apache-2.0 | 95 | master | 389 | class CreateExamScores < ActiveRecord::Migration
def self.up
create_table :exam_scores do |t|
t.references :student
t.references :exam
t.decimal :marks, :precision => 7, :scale => 2
t.references :grading_level
t.string :remarks
t.boolean :is_failed
t.timestamps
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.