similar to: Calling a method in console

Displaying 20 results from an estimated 4000 matches similar to: "Calling a method in console"

2006 Apr 17
3
model.models.models or model.models.find(:first).models
I the following three models which all have has_and_belongs_to_many # User <-> UserGroup <-> Permissions class UserGroup < ActiveRecord::Base has_and_belongs_to_many :users, :join_table => "user_usergroup_join" has_and_belongs_to_many :permissions, :join_table => "usergroup_permission_join", :uniq => true end I can do this: permissions =
2006 Feb 07
1
habtm :uniq causing duplicate inserts? How to update Rails?
Hello *Gem* experts, Sorry for asking multiple questions in one post but they are both related to one problem. So far I have the following code: class Member < ActiveRecord::Base has_and_belongs_to_many :blogs, :uniq=>true ..... end class Blog < ActiveRecord::Base has_and_belongs_to_many :members, :uniq=>true ... end The issue is that
2006 Feb 19
4
Multiple HABTM to one table
I have a class Player, and a class Game. Game has two HABTM relationships to the Player table through seperate relationship tables. class Game < ActiveRecord::Base has_and_belongs_to_many :players, :uniq => true has_and_belongs_to_many :victors, :class_name => ''Player'', :uniq => true end When I add Player A to players, and Player B to victors, and save the
2007 Dec 09
4
Help on drying code
Hi all, Currently I''m having to do this: def self.authorized_roles(controller, action) specific = self.find_by_controller_and_action(controller, action) all_actions = self.find_by_controller_and_action(controller, ''*'') all_controllers = self.find_by_controller(''*'') role_ids = [] specific.each do |role_item| role_ids <<
2007 Nov 21
2
uniq -c
Is there an R analog of the Unix command uniq -c: http://en.wikipedia.org/wiki/Uniq Given an array x, uniq -c replaces each contiguous subsequence of identical numbers with a tuple (count, number). E.g. $ cat > usample 10 10 9 8 8 7 7 7 6 3 1 1 1 0 $ uniq -c usample 2 10 1 9 2 8 3 7 1 6 1 3 3 1 1 0 Cheers, Alexy
2006 Jul 13
10
Book Question on RoR
Hi there, I am a newbie and interested in learning Ruby on Rails. I see there are 2 books out there: Ruby for Rails Ruby techniques for Rails developers David A. Black and Agile Web Development with Rails : A Pragmatic Guide (Pragmatic Programmers) Dave Thomas, David Heinemeier Hansson, Andreas Schwarz, and Thomas Fuchs Which one should I get? "Agile Web Development with Rails"
2009 Oct 08
3
[PATCH] fix storages crazyness
Signed-off-by: Loiseleur Michel <mloiseleur at linagora.com> --- app/models/vm.rb | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/app/models/vm.rb b/app/models/vm.rb index 88e0aef..0be3f89 100644 --- a/app/models/vm.rb +++ b/app/models/vm.rb @@ -27,7 +27,7 @@ class Vm < ActiveRecord::Base find(:all, :conditions=>{:state=>Task::STATE_QUEUED})
2014 Jul 19
1
patch about mingwbuild 4.9.1
recently I used gcc 4.9.1 (http://sourceforge.net/projects/mingw-w64/files/Toolchains targetting Win64/Personal Builds/mingw-builds/)on windows to build R,but failed when link R.dll ,it report linker status 5.  after some digging, I found when use gcc 4.9.1 64 bit on windows there are lots of .refptr.*(* is r function name) in R.def, which lead build fail.so I add a simple path to
2010 Feb 02
1
ggplot/time series with indicators question
Hello, I am trying to plot time-series data with certain weeks highlighted using symbols. require(ggplot2) #plotting time series data timescale <- seq(as.Date("01/01/09","%m/%d/%y"), length.out=12, by=7) data.all <- data.frame( id = c(rep('111',12),rep('222',12),rep('333',12)), week=c(timescale,timescale,timescale),
2006 Dec 05
4
has_many with :uniq not working for me
Hi all, I have a relationship (no really!) class RiskMatrix < ActiveRecord::Base has_many :severities, :order => :position, :uniq => true end class RiskFactor < ActiveRecord::Base belongs_to :risk_matrix validates_presence_of :descriptor, :example validates_uniqueness_of :descriptor, :example, :scope=> :risk_matrix_id end class Severity < RiskFactor
2005 Apr 26
1
ldap uid with static gid problem
hi, i'd like to use dovecot to authenticate from ldap. in ldap each user has it's uniq uid and gid. unfortunately with postfix we can't use uniq uid/gid since in this case we have ot create all user's home in advance. so we decided to use uniq uid and a common gid in postfix since in this case postfix can create new users maildir and deliver new mails. so i'd like to
2006 Mar 28
5
Anyone use .uniq! ???
could anyone by chance give me a working example of the .uniq! method? i''ve been trying all day. any help would be much appreciated! jon -- Posted via http://www.ruby-forum.com/.
2006 Mar 24
2
Return all rows, split then show uniques
I''m returning some rows from a tags database that look like this: ID WORDS 1. apple banana pear 2. banana melon 3. apple peach lime What I want to do with that data is use the .split method to divide them into separate values in an array, then use the .uniq method to return a unique list of the words like so: apple, banana, pear, melon, peach, lime So in my controller I
2018 Apr 27
1
wiki suggestions, part 2
Am 26.04.2018 um 20:07 schrieb Harry Jede via samba: > No, i have created 2 users with same sid. > > root at capella:~# pdbedit -Lv | grep "User SID" | sort|uniq -d > root at capella:~# > > root at capella:~# pdbedit -L|grep Failing > ldapsam_getsampwsid: More than one user with SID [S-1-5-21-3958726613-3318811842-4132420312-21010]. Failing. count=2 >
2011 May 19
3
A better way to do this
Hello gurus, I have a dataframe containing two groups viz., 'control' and 'case', each of these groups contains longitudinal data for 100 subjects. I have to plot all these subjects on a single chart and then put a regression line for each of the group for all the subjects. I have written a function to do the chart grpcharts<-function (dat, group,group2,molecule,cutoff){
2004 Dec 27
2
bidirectional synchronization of dovecot-managed maildirs
Hello and happy holidays, I've been thinking about high performance bidirectional synchronizing the mail on my laptop (which is frequently disconnected) and my workstation at work (which is always on and receives all inbound mail). Both run dovecot on top of maildir. I've been playing with offlineimap, unison (which I already use for all my non-mail files), as well as the gnus agent (in
2009 Aug 19
2
[LLVMdev] Build issues on Solaris
Duncan Sands wrote: > Hi Nathan, > > >> The latter being what GenLibDeps.pl expects to see. All else being >> equal though, it might be better to change GenLibDeps.pl to recognize >> the first version: >> --- GenLibDeps.pl (revision 78653) >> +++ GenLibDeps.pl (working copy) >> @@ -100,7 +100,7 @@ >> print "
2012 Sep 06
4
Why the error is coming, can anyone help?
Hi everyone Can anyone help? x = c("Treatment", "Planned", "Actual", "Demographics", "Outcomes") for (i in x) { df <- paste(i)[, c("Reference_ID", "Arm_ID")] unique(df) -> uniq as.data.frame(table(uniq$Reference_ID)) -> y i.Arms<- paste(y$Var1, y$Freq, sep="_") Print_Message("Check for the Total No of
2012 Feb 02
1
Quick bash tip for finding free SIP extensions from your sip.conf
Created this function on one of my machines today, thought others might find it useful: freesip() { comm -2 <(seq $2 $3) <(cat $1 | grep ^\\[ | sort | uniq | tr -d \[ | tr -d \]) | grep ^[[:digit:]] } On RedHat/CentOS based systems you can create the following file to have the function available on login: /etc/profile.d/freesip.sh # Free SIP extensions freesip() { comm -2 <(seq $2
2009 Aug 19
0
[LLVMdev] Build issues on Solaris
Hi Nathan, > The latter being what GenLibDeps.pl expects to see. All else being > equal though, it might be better to change GenLibDeps.pl to recognize > the first version: > --- GenLibDeps.pl (revision 78653) > +++ GenLibDeps.pl (working copy) > @@ -100,7 +100,7 @@ > print " <dt><b>$lib</b</dt><dd><ul>\n";