similar to: Including a Module within a model

Displaying 20 results from an estimated 10000 matches similar to: "Including a Module within a model"

2006 Apr 14
1
SaltedHashLoginGenerator Integration Woes
I''m trying to modify the SaltedHashLoginGenerator to where it separates the users table into two tables: a users table which contains login info: token, salt, etc) and userprofiles table (which contains firstname, lastname, authlevel, etc) I''m trying to use the existent helper for user under app/helpers/user_helper.rb and copied to app/helpers/userprofiles_helper.rb and
2009 Aug 31
2
Asterisk Regular expression to validate any phonenumber
Hi I am using asterisk version 1.6.0.5 I have build up one utility that will fire Originate Action on Manager... In which, i have define number to call eg. 919912312345 (MobileNumber) How can i know that this number format is true for Indian Number... In originate action, user can enter any international number.. How can I came to know this number format is right for that country...?? IS there
2006 Nov 04
0
Validations ignoring :allow_nil => true
I have an address model and am doing some validations. One of them seems to ignore :allow_nil => true. If I leave the phone input blank, I get it back with a "too short" error. Here''s the relevant parts of the model: 1. class Address < ActiveRecord::Base 2. 3. validates_length_of :phone, :in => 7..10, :allow_nil => true 4. 5. before_validation
2011 Jun 26
1
ActionView::Template::Error (Cannot modify SafeBuffer in place):
Hello, Trying to upgrade an app that was running fine in 3.0.3 to 3.0.9 and while everything works well, I get this error: ActionView::Template::Error (Cannot modify SafeBuffer in place): When passing a string to this function (in application_helper.rb) through a simple: <%= format_me(article[shortdesc])%> def format_me(text, html_options={}, options={}) text =
2011 Jun 19
1
before before_validation callback
Hi, I was looking around a bit and couldn''t find any callbacks that executed before before_validation The current problem with using before_validation is that it won''t fire if I''m not using validations with #save(:validate => false) - which makes sense. Before_save won''t suffice because I want these callbacks to fire before validation on the occasions that
2007 Apr 05
0
unexpected behavior of before_validation
Today I found these comments in active record''s callbacks.rb file: # If the returning value of a before_validation callback can be evaluated to false, the process will be aborted and Base#save will return false. # If Base#save! is called it will raise a RecordNotSave error. # Nothing will be appended to the errors object. This caused me a lot of frustration earlier when I was
2013 Sep 09
2
Invalid UTF-8 with gsub(perl=TRUE) and iconv(sub="")
Hi! I experience an error with an invalid UTF-8 character passed to gsub(..., perl=TRUE); the interesting point is that with perl=FALSE (the default) no error happens. (The character itself was read from an invalid HTML file.) Illustration of the error: gsub("a", "", "\U3e3965", perl=FALSE) # [1] "\U3e3965" gsub("a", "",
2011 Sep 02
0
No subject
typing his number, though there is a 15 seconds timeout, and even if I type the number very fast it still may happen to me. *same => n,Read(mobileNumber,app/input-mobile,10,,2,15)* In the logs: When it fails: - - <SIP/ipbx-iwred-000002e> Playing 'app/input-mobile.slin' (language 'fr') - - User disconnected When it succeeds: - - <SIP/ipbx-iwred-000002e> Playing
2007 Sep 05
1
gsub question, not a regex question...including part of the original in the sub...
Hi all, I''ve got a simple bulletin board type of code in part of my application, and I want to implement phpbb-like tags for users to add to posts. I strip HTML out of the posts, of course. I can handle things like [b] => <b> with a simple gsub, but there''s one that is throwing me for a loop. I want users to be able to quote other users, and have the quoted text show
2006 Feb 13
0
Asterisk register ip phone
Hi all I have a problem to register a cisco 7960 to an asterisk 1.2.2 I defined in sip.conf the next : ["phonenumber"] type=friend username="username" secret="password" host=dynamic context=work I am trying to catch the register requests with sip debug with no success (empty screen). I can only catch the register messages with ngrep on
2006 Feb 19
1
Cisco 7960 Register Problem
Hi all I have a problem to register a cisco 7960 to an asterisk 1.2.2 I defined in sip.conf the next : ["phonenumber"] type=friend username="username" secret="password" host=dynamic context=work I am trying to catch the register requests with sip debug with no success (empty screen). I can only catch the register messages with ngrep on host it's comming
2007 Jan 18
1
Internet Explorer - Sanitize Uploaded Filenames
Hi all, Somewhat of a noob here. I have a table that has 5 file fields, and they are named file, file2, file3, file4, file 5. All of them will be .doc files. In firefox, I can upload these files just fine, and they will show up as Document.doc. In IE, it prepends the entire path. C:\My Documents\User\Desktop\Document.doc Which makes the file unreadable, and un-downloadable. I know that the
2006 Mar 24
1
Problems with before_validation
Hi all My visitors can create party organisator profiles, and I want assign them as the creators (the field creator_id in the organisators table references a member in the members table). To do that I tried it with before_validation: def before_validation creator = Member.find 1 end Sadly, this does not work. The validation validates_presence_of :creator_id Still tells me, that
2005 Aug 27
1
SIP Registration failure
Hi list, I'm in central-europe and signed yesterday a broadvoice account. My Asterisk box is CVS 2005-08-25. Problem I face is: "Failed to authenticate on REGISTER to 'phonenumber@sip.broadvoice.com' (Tries 2)" then "Registration for 'phonenumber@sip.broadvoice.com' timed out" and finaly "Giving up forever to register
2005 Nov 22
1
Patches?
I have a few of patches for RC. A quick fix for a bug in clean_html, an improvement to clean_html to sanitize more links, and the addition of "filter_classes" and "filter_ids". What should I do? Email them to someone? why? (sorry, couldn''t avoid it) I actually don''t have separate patches for each, but could do them if needed. The first two are
2006 May 08
0
Including common code among multiple web services issue?
Hi all - I''m implementing some web services and every one has at the very least a "find_newer_than" method. In my models, I''ve split things up like this and it works great. ---------------------------------------------------------------------------------- class XyzService < WebService web_service_api XyzApi .... service specific methods go here... end class
2013 Jan 18
1
Object created within a function disappears after the function is run
Dear R-helpers, I have run the code below which I expected to make an object called dd1, but that object does not exist. So, in summary, my problem is that my function is meant to make an object (dd1), and it does indeed make that object (I know that the last line of the function prints it out) but then, after the function has run, the object has disappeared. It's late on a Friday so I may
2009 Jun 24
2
At my wits end ! Controlling passed in negative values from a form
Hi, I am trying to validate a numeric value passed in from a form, which is saved in a MySQL db as decimal(9,2) Now problem is I need to ensure people don''t enter a form value like -. 003. In my validations, I have a validates_numericality_of check being done. Furthermore, in validate method, I have a check using an if statement such as : ((an_object[n].nil? or an_object[n] < 0) and
2006 May 09
1
Asterisk settings Net2Phone
Hi, I?m looking for settings to configure net2phone carrier in my asterisk. I found this configurations, but it?s not work. I don?t known if this configuration is for voice line or voice access account. Anybody can help me, with other configuration? Thanks. ---- *sip.conf* [general] useragent = X-Lite release 1103m register => PHONENUMBER:PASSWORD@sip.net2phone.com [net2phone] type = peer
2006 Nov 13
1
Sending '#' with Dial
Hi! I have a working asterisk-setup with four sip-clients. Everything works great but when the users call someone the phonenumber shows up on the receiving ends callerid-display. To correct this my provider told me to send #31# before the phonenumber, tried this with: Dial(SIP/#31#${EXTEN}@provider) but my asterisk tells me that it isn't a valid extension. The INVITE looks fine,