Displaying 9 results from an estimated 9 matches for "task_nam".
Did you mean:
task_name
2008 Aug 24
1
avoiding exceptions in views
when rendering a view, if the object being rendered doesn''t respond to a
method it raises an error message.
For example, I have an Employee class and each employee has many Tasks.
So I may call:
<%= employee.tasks.first.task_name %>
If, for some reason an employee has 0 tasks associated with it, the
above template method would raise an exception.
Is it efficient to loop through the @employees array, with something
like:
@employees = Employee.find(:all,...).collect{|e| e if e.tasks.size >
0}.compact
or is there a b...
2004 Apr 02
2
Futzing with TaskScheduler
...just DTRT (do
the right thing).
Also, I mostly dislike camel case and I''m not sure what logic MS used when
it chose "BeginX" versus "StartX". I''m just going to use "start". So for
now I''m looking at something like this:
t = Trigger.new(task_name,some_host)
t.trigger = {
:start_year => 2004
:start_month => 4
:start_day => 25
:start_hour => 23
:start_minute => 5
:trigger_type => DAILY
:week => FIRST | LAST
:dow => MONDAY | TUESDAY | WEDNESDAY
:months => JANUARY | FEBRUARY | MARCH
}
How...
2005 Dec 30
1
Need serious help - unit testing without a database
I''ve created a model, let''s just call it Person
class Person
attr_accessor :first_name, :lastname
def full_name
@first_name + " " + @last_name
end
end
I''m using this in my Rails application. My Rails application does not
use a database of any kind, and this model is obviously not a subclass
of ActiveRecord::Base. I can''t unit test this
2006 Apr 06
4
using two foreign keys to the same table
...ield for the
assignee. both of these fields reference the users table. obviously i
can''t have two fields that say user_id in my tasks table, so how do i
get them to link right and specify a different field?
here is my current database schema:
_Tasks_
id int not null auto_increment,
task_name varchar(100) not null,
description text not null,
user_id int not null,
assignee int not null,
date_due date not null,
completed_at datetime not null,
constraint fk_task_user foreign key (user_id) references users(id),
constraint fk_task_assignee foreign key (assignee) references
us...
2006 May 02
4
How to extend rails rake tasks?
Does anyone know how to extend the buit-in rake tasks like test:unit.
I want to custom load some fixtures in a particular order.
Thanks,
Zack
2006 Jun 20
0
habtm has_many through and foreign keys
I have two models
Role and Task
..and a join table/model RoleTask
Now both roles and tasks have id as a primary key and name which is a
unique identifier
I want the join table to hold role_id and task_name
I''ve tried using habtm with foreign key and association foreign keys set
up and I''ve tried using has_many :through
..but they all seem to someone want to work with the primary keys of
both roles and tasks.
Do I need to set the primary key of tasks to be the name field?
thank...
2006 Apr 06
3
sortable list not saving to database
...sk.save
end
render :nothing => true
end
and in my view, i have:
<h2><%= @user_list.full_name %>''s Tasks</h2>
<ul id="user-list">
<% @user_list.tasks.each do |task| -%>
<li id="item_<%= task.id %>">
<%= task.task_name %>
</li>
<% end %>
</ul>
<%= sortable_element ''user-list'',
:url => { :action => ''sort'', :id => @usr_list },
:complete => visual_effect(:highlight, ''user-list'')
%>
everything seems like it works great....
2006 Apr 07
1
changing visual_effect defaults
what is the correct syntax for changing an effect like :highlight? i
tried looking through the api, and found it, but i can''t seem to get it
right.
i want to change the start color of visual_effect(:highlight,
''user-list''). i tried visual_effect(:highlight, ''user-list'', :startcolor
= ''#990000'') and several other variations of
2010 Dec 09
0
invoke rake tasks
Hello
I have script in Rails root folder like this
tasks = [some tasks...]
tasks.each do |task|
fork do
Rake::Task[task].execute
end
end
And get the error "Don''t know how to build task". How to execute my
tasks?
In terminal rake task_name works correctly
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe f...