Displaying 3 results from an estimated 3 matches for "priority_id".
2006 May 26
7
migration with required data
...Priority model, modify my Bug model with a belongs_to
:priority and create my migration like so:
class CreatePriorities < ActiveRecord::Migration
def self.up
create_table :priorities do |t|
t.column :name, :string, :limit => 25, :null => false
end
add_column :bugs, :priority_id, :integer, { :null => false, :default
=> 1 }
end
def self.down
remove_column :bugs, :priority_id
drop_table :priorities
end
end
My question is how to handle getting data into the Priorities table
during the migration. When I call add_column, I update all Bug records
to hav...
2006 Mar 08
1
Nil Object Error
...edit/update of records when using form
validation. Here are my files for reference.
ticket.rb
============
class Ticket < ActiveRecord::Base
belongs_to :agent
belongs_to :status
belongs_to :priority
belongs_to :category
validates_presence_of :employee_id, :date, :agent_id, :status_id,
:priority_id, :category_id, :summary
end
ticket_controller.rb
============
class TicketController < ApplicationController
layout "standard-layout"
scaffold :Ticket
def edit
@ticket = Ticket.find(params[:id])
@employees = Employee.find_all
@agents = Agent.find_all
@statuses = Status.f...
2006 Nov 28
0
tzinfo_timezone/tzinfo can't modify frozen object
...s_user.tz.utc_to_local(ticket.created_at))%> by <%=
name_or_me(ticket.submitter_id, Proc.new {ticket.submitter.name})%>
30: | <%=ticket.status%> <%if
ticket.ticket_type_id?%><%=ticket.ticket_type.downcase%><%end%>
31: <%if ticket.priority_id?%> | <%=ticket.priority%>
priority<%end%>
32: <%if ticket.linked_id%>
#{RAILS_ROOT}/vendor/plugins/tzinfo_timezone/lib/tzinfo_timezone.rb:210:in
`tzinfo''
#{RAILS_ROOT}/vendor/plugins/tzinfo_timezone/lib/tzinfo_timezone.rb:184:in
`utc_to_local'...