}
class MantisUser < ActiveRecord::Base
- set_table_name :mantis_user_table
+ self.table_name = :mantis_user_table
def firstname
@firstname = realname.blank? ? username : realname.split.first[0..29]
end
class MantisProject < ActiveRecord::Base
- set_table_name :mantis_project_table
+ self.table_name = :mantis_project_table
has_many :versions, :class_name => "MantisVersion", :foreign_key => :project_id
has_many :categories, :class_name => "MantisCategory", :foreign_key => :project_id
has_many :news, :class_name => "MantisNews", :foreign_key => :project_id
end
class MantisVersion < ActiveRecord::Base
- set_table_name :mantis_project_version_table
+ self.table_name = :mantis_project_version_table
def version
read_attribute(:version)[0..29]
end
class MantisCategory < ActiveRecord::Base
- set_table_name :mantis_project_category_table
+ self.table_name = :mantis_project_category_table
end
class MantisProjectUser < ActiveRecord::Base
- set_table_name :mantis_project_user_list_table
+ self.table_name = :mantis_project_user_list_table
end
class MantisBug < ActiveRecord::Base
- set_table_name :mantis_bug_table
+ self.table_name = :mantis_bug_table
belongs_to :bug_text, :class_name => "MantisBugText", :foreign_key => :bug_text_id
has_many :bug_notes, :class_name => "MantisBugNote", :foreign_key => :bug_id
has_many :bug_files, :class_name => "MantisBugFile", :foreign_key => :bug_id
end
class MantisBugText < ActiveRecord::Base
- set_table_name :mantis_bug_text_table
+ self.table_name = :mantis_bug_text_table
# Adds Mantis steps_to_reproduce and additional_information fields
# to description if any
end
class MantisBugNote < ActiveRecord::Base
- set_table_name :mantis_bugnote_table
+ self.table_name = :mantis_bugnote_table
belongs_to :bug, :class_name => "MantisBug", :foreign_key => :bug_id
belongs_to :bug_note_text, :class_name => "MantisBugNoteText", :foreign_key => :bugnote_text_id
end
class MantisBugNoteText < ActiveRecord::Base
- set_table_name :mantis_bugnote_text_table
+ self.table_name = :mantis_bugnote_text_table
end
class MantisBugFile < ActiveRecord::Base
- set_table_name :mantis_bug_file_table
+ self.table_name = :mantis_bug_file_table
def size
filesize
end
class MantisBugRelationship < ActiveRecord::Base
- set_table_name :mantis_bug_relationship_table
+ self.table_name = :mantis_bug_relationship_table
end
class MantisBugMonitor < ActiveRecord::Base
- set_table_name :mantis_bug_monitor_table
+ self.table_name = :mantis_bug_monitor_table
end
class MantisNews < ActiveRecord::Base
- set_table_name :mantis_news_table
+ self.table_name = :mantis_news_table
end
class MantisCustomField < ActiveRecord::Base
- set_table_name :mantis_custom_field_table
+ self.table_name = :mantis_custom_field_table
set_inheritance_column :none
has_many :values, :class_name => "MantisCustomFieldString", :foreign_key => :field_id
has_many :projects, :class_name => "MantisCustomFieldProject", :foreign_key => :field_id
end
class MantisCustomFieldProject < ActiveRecord::Base
- set_table_name :mantis_custom_field_project_table
+ self.table_name = :mantis_custom_field_project_table
end
class MantisCustomFieldString < ActiveRecord::Base
- set_table_name :mantis_custom_field_string_table
+ self.table_name = :mantis_custom_field_string_table
end
end
class TracComponent < ActiveRecord::Base
- set_table_name :component
+ self.table_name = :component
end
class TracMilestone < ActiveRecord::Base
- set_table_name :milestone
+ self.table_name = :milestone
# If this attribute is set a milestone has a defined target timepoint
def due
if read_attribute(:due) && read_attribute(:due) > 0
end
class TracTicketCustom < ActiveRecord::Base
- set_table_name :ticket_custom
+ self.table_name = :ticket_custom
end
class TracAttachment < ActiveRecord::Base
- set_table_name :attachment
+ self.table_name = :attachment
set_inheritance_column :none
def time; Time.at(read_attribute(:time)) end
end
class TracTicket < ActiveRecord::Base
- set_table_name :ticket
+ self.table_name = :ticket
set_inheritance_column :none
# ticket changes: only migrate status changes and comments
end
class TracTicketChange < ActiveRecord::Base
- set_table_name :ticket_change
+ self.table_name = :ticket_change
def time; Time.at(read_attribute(:time)) end
end
CamelCase TitleIndex)
class TracWikiPage < ActiveRecord::Base
- set_table_name :wiki
+ self.table_name = :wiki
set_primary_key :name
has_many :attachments, :class_name => "TracAttachment",
end
class TracPermission < ActiveRecord::Base
- set_table_name :permission
+ self.table_name = :permission
end
class TracSessionAttribute < ActiveRecord::Base
- set_table_name :session_attribute
+ self.table_name = :session_attribute
end
def self.find_or_create_user(username, project_member = false)