Displaying 20 results from an estimated 20244 matches for "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 1)"
category = params[:category]
department = params[...
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 comp...
2006 Jun 30
14
Saving boolean attributes
...oing 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
@department = Department.find(params[:id])
@department.active_flag = false
@department.save!
redirect_to :action => ''list''
end
Since I''m using save!, I''m getting the error:
Validation failed: Active flag can''t be blank
Anybody know why the ac...
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")
@department.people <...
2007 Jan 17
2
rake test and validates_inclusion_of
...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 fail are always ones that are asserting that a
model, which has a reference to another model, is OK. So for example,
one assertion that passes when I do `ruby
test/unit/department_test.rb`, but fails when I do `rake test` is:
department = Department.new(:name => "super department",
:parent_id => departments(:administration_department).id)
assert department.save
When I print out department.errors, I see that parent_id is invalid
because it "...
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...
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 Department
====>> Intra Department -> Service Department Tender, Exports, Accounts, Customer Care,Logistics
====>&...
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
...9;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 of when department name changes have occurred.? For the Bob example below, there was a payment on 2016-01-01 which occurred in H229000.? In 2012, this department was named "Modified Name", in 2019 the departm...
2007 Dec 03
5
spec for model_id should eql
...her 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 address
object'' FAILED
expected 3, got nil (using .eql?)
This spec that is failing:
@address.department_id.should eql(3)
before:
before do
@address = Address.new
@address.attributes = valid_address_attributes
@address.save
@department = mock_model(Depar...
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 many stores and a Store has many Department. However,
both Store and Department have many products. An product has the
columns store_id and department_id which are mutually exclusive. This
is because a P...
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_upda...
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...
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.
...s 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 end. Any help is appreciated.
Problem Statement ------------
PrototypeModel has many Departments .
Departments may also be grouped within Departments.
Trying to create a new PrototypeModel and populating the departments
(behind the scenes) from a template PrototypeModel specified by the
user in params[:prototype_model][:parent_id].
The save of the PrototypeModel fails as the new D...
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 call_history and
department? The problem is that they are in different folders (root and
helpdesk, resp...
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...