Displaying 20 results from an estimated 20242 matches for "departs".
Did you mean:
depart
2006 Apr 11
4
wrong number of arguments (2 for 1)
Hi,
Im having trouble figuring out how to query my database in ruby and
i''m hoping someone can help me out.
I''d like to find all my departments that match a permalink passed from
the url. The department must also match a particular category, also
passed through the url.
I have written the following code. But unfortunatley I get an error
"wrong number of arguments (2 for
2006 Mar 30
3
Model.find(:all) where Model.association has more then 0 items?
Hi everyone,
I have a Department model that has_many people. How do I go about
finding all departments with more than 0 people?
Department.find(:all, :conditions => Department.people.size > 0)
That, of course, doesn''t work, but it was as close as I could come.
Thanks!
Sean
2002 Feb 19
2
Need help for samba share and unix group
Hi all,
I configured samba version 2.2.1a-4 on linux RedHat
and many share folders for department.
this is the configure
d---rwx--- 13 account account .. .. Accounting
d---rwx--- 4 admin admin .. .. Administration
d---rwx--- 5 director director .. .. Directors
d---rwx--- 9 hrd hrd .. .. Hrd
[accounting]
2006 Apr 06
6
pagination question
i''ve figured out how to use the next and previous links with the
paginator class but now i''m trying to figure out how to display all the
page numbers in between. looking through the rails api, i found
paginator.each() but i''m not sure how to use it, or if that''s even what
i am looking for.
also, is there a way to limit the amount of pages like some sites
2006 Apr 26
2
two layers of has_many
Hi,
There are many companies. Each company has many departments. Each
department has many employees. The following find_by_sql method seems
awful. What is the best way to get all the employees of a company?
class Company < ActiveRecord::Base
has_many :departments
def employees
Employee.find_by_sql("SELECT employees.*
FROM companies, departments, employees
2006 Jun 30
14
Saving boolean attributes
Hi,
I''m just learning Ruby on Rails and ran into something where I know I''m
either doing something very stupid or I''m missing something.
My model as a boolean attribute called active_flag. In my Sql Server
database this is stored as a bit value. I then setup a method in my
controller called "deactivate". This is very simple, it does:
def deactivate
2006 Mar 13
3
validation and update
Hi,
I have validation working in a situation similar to the following.
(Please forgive any minor typos below)
class Department < ActiveRecord::Base
has_many :people
end
class Person < ActiveRecord::Base
belongs_to :department
validates_presence_of :name
end
@department = Department.new(:name=>"bedrock")
@department.people << Person.new(:name=>"fred")
2007 Jan 17
2
rake test and validates_inclusion_of
Hello,
I am just starting off with Rails, so I apologize in advance if there
is a terribly obvious answer to my problem. I''ve done some searching
and found similar problems to my own, but nothing which yielded a
solution.
I have a handful of models that I am unit testing. The tests for each
unit run successfully, but when I do a rake test, many of the tests
fail.
The assertions that
2005 Mar 29
6
Aggregating data (with more than one function)
I have the data similar to the following in a data frame:
LastName Department Salary
1 Johnson IT 56000
2 James HR 54223
3 Howe Finance 80000
4 Jones Finance 82000
5 Norwood IT 67000
6 Benson Sales 76000
7 Smith Sales 65778
8 Baker HR 56778
9 Dempsey HR 78999
10 Nolan
2007 Dec 03
1
Samba Mount Problem
Dear Tux Friends,
I am migration a MS Windows 2000 file server to OpenSuse 10.3. In the current working scenerio, there is one directory on Windows Server named "Common" with two shared directories 1) Inter Department 2) Intra Department
This will will help to understand the directory structure:
===>> Common-> Inter Department
-> Intra
2006 Mar 13
7
Problem with params
I''ve got a User model, which holds the following (excerpt):
def try_to_authenticate
User.authenticate(self.username, self.password)
end
..
private
def self.hash_password(password)
Digest::SHA1.hexdigest(password)
end
def self.authenticate(username, password)
@user = User.find(:all, :conditions => ["username = ? AND
password = ?",
2018 Feb 01
2
Data Table Merge Help
Hello
I'm not sure if this is an appropriate use of this mailing list or not, please let me know if it isn't.? I'm struggling to figure out how to merge two data tables based on max effective date logic compared to when a payment occurred.? My dtDistributions DT is a transactional dataset while dtDepartments is a domain data set containing all department names and the effective date
2007 Dec 03
5
spec for model_id should eql
Hello,
I''m confused why the spec described below is failing. Other simple
comparison specs are passing fine for the same model. The code is working
accordingly when I test it through the console, I''m just having difficulty
getting this spec to work. Any pointers would be appreciated.
Failure message:
''Address fetch and geocode should extract department and write to
2010 Aug 02
7
Complex associations
I am working on a project that has some complex table associations,
and I am having a hard time declaring this association in a Model, and
fear it can''t be done.
Here is an example of my issue...
class StoreType < ActiveRecord::Base; end
class Store < ActiveRecord::Base; end
class Department < ActiveRecord::Base; end
class Product < ActiveRecord::Base; end
A StoreType has
2006 Mar 13
3
validates_associated problem
Hello,
I have a situation where an ''employee'' belongs to a ''department'' and
have setup the relationship as follows.
class Employee < ActiveRecord::Base
belongs_to :department, :foregin_key => "department_id"
validates_associated :department_id
end
class Department < ActiveRecord::Base
has_many :employees
def validate_on_update
2006 Aug 14
1
Rest, routes, path_prefix and default params
I am trying to use routes with default params to have routes
''/mycompany/departments''
and
''/companies/1/departments''
mean the same thing (both restful routes).
When I set up the files as below, I get an error of
''Couldn''t find Company without an ID''
and my log file shows the following ..
Processing DepartmentsController#index (for
2006 Feb 27
1
Help with tricky object relations
In a document management system I''m building each document belongs to
a company and a department in that company. So far so good, but the
problem is that a single document can also belong to multiple
companies and departments.
What I would like to do is to have different pages with links to
documents for each company and on those pages divide them under the
departments.
What is the best
2009 Feb 19
3
Associated child records not created on creation of a parent.
I am trying to create a record with association. Within the create
method, I would also like to pre-populate dependent (has_many) records
from a template in the database.
The child records are <u>mysteriously rolled back </u> if I insert
them in a loop. If I try to insert a single child record, it works.I
have read the books and tried to google my way out of this but am at a
dead
2006 Apr 11
3
model classes in different folders
Hello,
I have the following structure:
- app
- controllers
- helpdesk
- call_controller.rb (Helpdesk::CallController <
ApplicationController)
- models
- employee.rb
- department.rb (Department < ActiveRecord::Base)
- helpdesk
- call.rb
- call_history.rb (Helpdesk::CallHistory < ActiveRecord::Base)
Is it possible to have a relationship between
2009 Jan 28
2
Grouping problem
Hi all,
I have a problem with grouping like I have to give count of employes in each
department like
if in one company there is departments like
Mechanical, Computer, Fitting, electronics and Chemical
hear I have to retreave the number of employes in each department and as
well as
I have to retreave number of John's in each department
is there any function is there which can solve my