Displaying 20 results from an estimated 1300 matches similar to: "reloading modules"
2006 Aug 15
2
to_xml and underscores
hi,
i am looking for a solution whereupon
calling myEntityObject.to_xml does not
convert my attributes containing underscores
into hyphens.
at the moment an attribute named "my_own_attribute"
is converted into <my-own-attribute>.
does anybody have an idea how to change that
and have to_xml generate <my_own_attribute>
thanks
ciao robertj
--
Posted via
2017 Feb 12
2
compiling asterisk-14.3.0-rc2
Thanks.
The configure run successfully.
but I got the warning below..
checking for the ability of -lsrtp to be linked in a shared object... no
configure: WARNING: ***
configure: WARNING: *** libsrtp could not be linked as a shared object.
configure: WARNING: *** Try compiling libsrtp manually. Configure libsrtp
configure: WARNING: *** with ./configure CFLAGS=-fPIC --prefix=/usr
configure:
2009 May 13
2
Object and Classes ?
I found a tutorial for creating classes using generic functions ? S3
way ! It was short description so I couldn't grok in full its
usage ... So far so good, what i currently do is something like this :
Blah <- function(data,...) UseMethod('Blah')
Blah.default <- function( ...... ) {
self = ....
class(self) <- 'Blah'
self
}
Blah.some_method <-
2006 Feb 15
2
extending rails via /lib - problems
I wanted to group some functions which I use in some models in one
place. Controllers have application.rb and views have helpers but I
couldn''t find anything about models. Using the /lib directory seemed to
be the only way.
Alright... so I have something like this:
/lib/code.rb
class ActiveRecord::Base
def method_a(n)
.......
end
def method_b(n)
........
end
end
2006 Jul 12
1
When to use Mutex::synchronize?
I have a simple question when to the synchronize method in the Mutex
class.
Now that backgroundrb has allow_concurrency = true there is no need
to synchronize database calls in threads.
The question I have is lets say I have a simple method in my worker
as follows:
def some_method
SomeModel.find_all each do |obj|
obj.some_count += 1
obj.save!
end
end
It accesses the database, but
2016 Mar 31
4
rsync with overlay tree
I maintain a directory structure containing dirs and files that I regularly push to ~50 hosts, which are divided into 3 groups that have slightly different needs (minor mods in a couple of files).
So ideally I would have 4 directories:
/path/to/sync/common/ <- common files
/path/to/sync/group1/ <- group1 specific only
/path/to/sync/group2/ <- group2 specific only
2006 Feb 18
5
Model methods and partial view templates
I have a method in a controller that invokes a
render :partial => ''some_partial_view''
In that view, I''m trying to access a method defined in a model, like
this;
<% for view in @an_array %>
<% local_var = view.some_method() %>
<% another_var = view.a_column_name %>
etc..
I am getting an undefined method error but the model is accessible
2006 Feb 16
10
Ruby class variables and access from view templates
I have an app that requires me to define a class variable (actually an
array) in a controller and then access it from within a view. It seems
that the class variables aren''t working right. Here is an example of
what I''m trying to do.
class DisplayController < ApplicationController
@@thumbnail_array = Array.new
...
def some_method
@@thumbnail_array = SomeModel.find_all
2006 Apr 14
5
state_models plugin and file_column?
I was looking at Kyle Mawell''s extremely nifty-looking StateModels
plugin
http://www.kylemaxwell.com/articles/2006/02/06/fun-with-single-table-inheritance
and before I go down the road with it, I was wondering if anyone has
used it with file_column.
The way file_column deals with an uploaded file -- by storing it to the
filesystem in a path that employs the model name and id --
2008 Jan 27
2
conditional validation
Hi,
How can I validate user info under certain conditions? For example, I
just downloaded a plug-in that allows me to validate phone numbers,
but what I would like is to only validate the phone number if it is
not blank and if the user_type_id field is equal to one.
How can I achieve such a validation in my user model?
Thanks, - Dave
--~--~---------~--~----~------------~-------~--~----~
You
2009 Apr 21
2
validates_uniqueness_of
hello all,
i am new to RoR programming and am struck with the functional test whole
checking for uniqeness of carriers. If it is not unique,the the bin
shudn''t be created.Can someone help me in correcting my code.
def test_create_failure_cycle_unique
begin
num_bins = Bin.count
post :create, {:bin => { :carrier => carriers(:A), :cycle =>
cycles(:one), :name =>
2010 Sep 16
3
Resyful authenticatio current_user in model
Hi,
I am using Restful authentication for user authentication.
I want the current logged in user object in my model property.rb
Problem is current_user is not working on model.
How can I fix this I need that?
Please help me out.
Thanks,
Mike
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk"
2007 Jun 18
2
weakness of helper?
Hi ,
It comes to me that helper has some weaknesses:
1) It is hard to test . No easy way to write test code for it.
(or Just i didn''t know?)
2) Not easy to reuse it on other controller/view/model.
it looks like to that putting the helper code into a model (a
fully helper model , or a mixed model) is good practice.
However i agree that some html intensive
2012 Sep 04
5
Associations and Math between Models
I''ve setup two models, 1 and 2, that are associated by
has_and_belongs_to_many. I''m trying to get an attribute from model_1 to use
in a method in model_2. When I use the code below, I get an error saying
''undefined method model_1_id''. What am I missing? Thanks!
Model_2.rb
Class Model_2 < ActiveRecord::Base
...
has_and_belongs_to_many :model_1
def
2006 Jul 25
3
Question about how Mongrel process works with singletons
Hi,
I have a controller where I access a singleton class that I use to
connect to a DRbprocess
DrbConnector.instance.some_method
I notice that on every request, the constructor is called so it is
making a new instance of this singleton. Is this normal?
Thanks,
Curtis
2006 Jul 14
3
Accessing the Model class from Controller
Hi,
I wonder if there''s an easy way to access the associated Model class
from its Controller. Something that would allow me to write snippets
like the following:
class PeopleController < ApplicationController
def some_method
person_model_class =
self.some_method_to_retrieve_the_person_model_class()
end
end
Cheers,
Marco
--
Posted via
2006 Mar 31
5
Model reloading problem
Hi all,
I''ve a model class Toto in the model directory.
I don''t understand why i have to restarts WebBrick to view changes i make
in this class
FYI : in the development. rb i desabled class cache with
config.cache_classes = false
Regards
Luciano
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
2006 May 21
1
how do I bypass using the standard layout for a file
Hi,
i''m trying dyamically add a bit of code into a page by updating a div.
this works great but it puts the page in with the standard layout around
it duplicating it.
Is there someway just to bypass using any layout with a rhtml file?
--
Posted via http://www.ruby-forum.com/.
2007 Mar 20
1
Passing Arguments to before_filter
I want to put a before_filter in application.rb, as follows:
before_filter :do_something, :except_controller => [:admin]
def do_something(options)
options.stringify_keys!
unless options[:except_controller].include?(controller_name)
# do something useful
end
end
Where I''m blocking is on how to get the ''options'' data in the do_something
method. I think I
2013 Jul 09
5
whenever gem
Hello All,
I want to schedule a mail every day.
I used whenever gem.
I added gem ''whenever'' in my gemfile. Then in the terminal I did -
"whenever ." which created a schedule.rb.
In schedule.rd I added this piece of code:-
set :environment, "development"
every 2.minutes do
runner "UserMailer.some_method"
end
Does it get invoked