similar to: cattr_accessor

Displaying 20 results from an estimated 500 matches similar to: "cattr_accessor"

2013 Apr 08
1
cattr_accessor and Thread.current prblems
Hello, I am trying to convert three applications to multitenant, all of them have same structure difference is only in little functions and template designs. All of them using cattr_accessor for setting currencies and other data, and it works perfectly Now i added app_id as cattr_accessor to App model to use it in default_scope to implement multi-tenancy class App < ActiveRecord::Base
2011 Sep 20
0
What's the difference between mattr_accessor and cattr_accessor in ActiveSupport?
Hi, I was reading source code of mattr_accessor and cattr_accessor in ActiveSupport and found out that the method definitions are all most identical. Except cattr_writer accepts a optional block. I googled and read http://stackoverflow.com/questions/2203800/difference-between-mattr-accessor-and-cattr-accessor-in-activesupport. That guy had the same question as me, but no one answered the question
2008 Aug 04
3
backslash in character string?
Dear list, After searching many old posts, I can't find the solution to a simple problem. can someone tell me how to create a character string with multiple backslashes, as in: file_dir <- c("C:\files\data\") I need to create this string and then paste it to many files names for batch processing in another software program. R won't accept the backslash and removes
2006 Mar 29
0
cattr_accessor missing for test of AR
Hello. I''m trying to test an active record adapter. When launching : ruby -I "connections\native_adaptername" anytest_test.rb I have an method missing error, complaining about cattr_accessor (missing from AR:Base). Any advice ? Tony PS : ruby 1.9, rails 1.10 install via gems -- Posted via http://www.ruby-forum.com/.
2006 Jan 05
0
cattr_accessor
Is this specific to rails? What''s it used for and when is it approriate to us it? Is there also a mattr_accessor? -- Posted via http://www.ruby-forum.com/.
2010 Feb 01
1
Reverse function how to
I'm using a script that does this: /usr/local/bin/rsync -tpv --files-from=/home/admin/bin/list_of_files / /home/admin/configuration/ I can't get the permissions on the files to stick, when the files are written they get root as owner. I run the script as root. Secondly I would like to reverse the sync so that I can move the directory configuration to another machine and make rsync
2012 Sep 22
4
Class, Module, Object
>> reload! Reloading... => true >> puts Class < Module true => nil >> puts Module < Class false => nil >> puts Module < Object true => nil >> puts Object < Module false => nil >> Object.parent => Object The above indicates that the Class object instance inherits from the Module object instance and the Module object instance
2006 Nov 24
13
rSpec on Rails 1.2?
I just updated my Rails install to the most current Edge and my controller specs fail: 1) TypeError in ''The User Controller should be a user controller'' can''t convert nil into String Each spec fails the same way. <context string> <spec string> can''t convert nil into String Any ideas what''s up with this? Thanks, s.ross
2012 Apr 11
1
Merging multiple .csv files
Hi all, I wish to merge 24 .csv files, each having a common identifier-column ("Name") and do two things: 1. Retrieve the common one's. [Analogy: while merging 2-dataframes, similar to using: merge (.... ,by="Name", all=FALSE) ] 2. Retrieve all, i.e., the union of the rows of 24 files. [again, somthing like: merge (.... ,by="Name", all=TRUE) ] On the web,
2006 Jul 05
2
Serialized object behaves weird
Hi! I got a class named EinsatzFilter which I serialized to session. Before saving to session it works afterwards I keep getting the message: "undefined method `to_s'' for #<Person:0x38c6ab8>". "Person" is a from ActiveRecord::Base inherited class. Code: class EinsatzFilter include ApplicationHelper attr_reader :personen, :monat, :projekte, :kunde
2006 Apr 06
7
LoginSystem : make @session available to models
Hello. LoginSystem is cool, it populates the @session instance variable of controllers with many useful info. The fact is : it would be cool to let models know about the session, too. For instance, after_update and after_create callbacks could store *who* did *what* on *what. Aim : having ActiveRecord::Base::session defined, returning the @session of the controller which manipulates the
2008 Sep 06
6
Configuring custom library
Hi, I''ve added a custom library called lib\AccountSystem like so: "module AccountSystem SINGLE = 1 MULTIPLE = 2 class << self attr_accessor :account_system_type end end" Now I wanna configure AccountSystem.account_system_type=AccountSystem::SINGLE in one app. I used an initializer: config/initializers/account_initialization.rb where I put this line in. I
2008 Dec 31
1
when to set a class attribute variable during boot
I have an ActiveRecord model with a cattr_accessor. The class attribute is set up like this: class MyModel < ActiveRecord::Base cattr_accessor :my_attribute end Because I need to give #my_attribute environment-specific values, I try to set this attribute in environments/development.rb like so: MyModel.my_attribute = 3 But this leads to odd and erratic behavior when #my_attribute is called
2007 Nov 14
2
Exception Notification plugin options hash handling????? backwards merge?
Today I worked on adding email exception notification to some ancillary background processes for a Rails app. Since I was already using Jamis'' exception notification plugin to notify me of errors in controllers for the web app, I figured that the path of least resistance was to try to figure out how to hook it into the daemon code. At first it looked easy. I just needed to
2009 Dec 11
3
Please help with a basic function
Hello, I am learning how to use functions, but I'm running into a roadblock. I would like my function to do two things: 1) convert an object to a dataframe, 2) and then subset the dataframe. Both of these commands work fine outside the function, but I would like to wrap them in a function so I can apply the code iteratively to many such objects. Here's what I wrote, but it doesn't
2010 Oct 01
8
field_with_errors.
If a model doesn''t pass validation the field in the view is put under a <div class="field_with_errors">. But who create that div? field_text helper do it? -- 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
2008 Nov 19
3
Mock today
In some of my unit tests, I find the need to set today to a different value than the actual today. For example, to test the model method "balance_of_today", which takes no argument, I want to have Date.today be a specific date for the purpose of testing. In other words, I want to do something like this: mock_today(Date.new(2008, 2, 1)) do ... test code... end My implementation for
2011 Feb 09
2
[LLVMdev] LLVM in Eclipse
Hi, I am new to Eclipse IDE. I am working with LLVM using command line for some time. Now I want to integrate it with eclipse IDE. Can anyone please give layman instructions how to import the llvm source project, install it and built it in the eclipse IDE. Sorry for this type of novice request. - Abhirup -------------- next part -------------- An HTML attachment was scrubbed... URL:
2007 Oct 12
2
how to know whether Vector B is a subset of Vector A
Hi, I'm quite fresh to R, and a layman of English as well. I hope I can make you understood. Now I have two vectors A and B. Is there any quick way to know whether B is a subset of A? and If B is a subset of A, can I know easily which elements in A (the index of A) equals to B's elements accordingly? For example, > a<-1:20 > b=c(2,5,9,7,4,8,3) > Question 1: we know b is a
2013 May 02
7
XFS vs EXT4 for mail storage
Hello, I'm in the process of finalizing the spec for my new dovecot VM, and this is the last question I need to address... I've read until I'm just about decided on XFS, but I have no experience with it (been using reiserfs on my old box (@ 8 yrs old now), and never had a problem (knock on wood), but considering its current situation (little to no development support for reasons