Displaying 20 results from an estimated 30000 matches similar to: "new plugin - please review and add suggestions"
2008 Jan 26
0
Error: no such file to load -- geokit (plugin is install)
Hi,
after spending hours on getting geokit and ym4r running I don''t know how
to do or how to getting a test running. I have try the tutorial from
http://www.railslodge.com/plugins/179-ym4r but I don''t get it :(.
Has sone one other tutorials he can recommend?
Maybe someone knows were I did my mistake (I only want to show a fixed
address, no database connection so far, pure
2006 Sep 19
1
Callback sto InstanceMethods in a plugin
Hello there,
I''m currently building a plugin, for which I need a before_save
callback. The method I want to call is in module InstanceMethods, but
when I add a before_save foo, foo, as defined as an InstanceMethod,
never gets called.
This is the first plugin I''m building, after only two weeks of fiddling
with Ruby and Rails, so if anyone is kind enough to help me out.... :)
2006 Jun 08
2
how to add plugin to ActiveRecord
I''m trying to set a date field''s day to the last day of the month before
I save it. I can do this successfully now using this code:
class Account < ActiveRecord::Base
def before_save
self.exp_date = last_day_of_month(self.exp_date)
end
# Returns a Date object set to the last day of the current month
def last_day_of_month(date = Date.today)
next_month_str
2012 Nov 10
6
Suggestion: `before_save on: :create` should either work or raise an exception
There''s a small inconsistency in ActiveRecord''s callback syntax that has
tripped me up before. It wouldn''t be a big deal, but it can lead to a
silent failure. I''d like to suggest that it either be made consistent or be
made to fail loudly.
The issue is that to do something before validating, but only when
creating, you use `before_validation on: :create`,
2011 Oct 14
2
before_save :encrypt_password
I am having a problem finding the best way to make a "before_save
:encrypt_password" conditional.
I have to at times update user model attributes but each time I do this
the password is reencrypted because of the above. I need to
differentiate between when the user is first logging in and the password
does need to be encrypted, and when they are already logged in and the
2004 Jun 27
1
Asterisk on 64 bit... and testing e164.org's stuff
works, but there are some issues.
I've had asterisk up and running on a suse 9.0 beta 7 x86_64 for about
two weeks now.
I used then-current cvs, and the compile went smoothly with only a dozen
complaints about 64 bit casting of pointer types.
The good news : Latency is effectively non-existent (especially when
compared to the lame c3 itx box I normally use), and asterisk has not
crashed
2006 Feb 10
4
before_save gotcha
Is it will known and accepted that before_save triggers should return
true? I didn''t notice this before but now I see it in the
documentation.
Here is what I''m doing in my model:
def before_save
if self.has_album?
self.visible = self.album.visible?
end
end
That results in the expected result when album.visible? is true - but
not when it is false. To make it
2007 Oct 20
0
Proper timestamps in callbacks
Yay, another Task model:
## the model
class Task < ActiveRecord::Base
attr_accessible :lots, :of, :stuff, :but, :not, :finished_at, :and, :finished
before_save do
@before_save.call if @before_save
end
def finish
self.finished = true
@before_save = proc { self.finished_at = Time.now }
end
end
## usage
t = Task.find(some_id)
t.finish
t.save
(same code on pastie:
2006 Jun 22
3
create pie chart
Hi,
I want to be able create a pie chart using rails, does anyone know of
any plugin''s taht could help me here?
Scott
--
Posted via http://www.ruby-forum.com/.
2010 Dec 14
2
Selecting non-empty elements after strsplit of string
Hello,
I am attempting to manipulate strings in which there are differing amounts of whitespace before and after each element taht I want to keep (any word, letter, or number). However, after strsplit and unlist, I know how to select specific elements with "[ ]", but I want to select instead all elements that are not missing. That is, do not select any elements that are simply
2006 Mar 02
2
How to get mime extension with file_column
Is there a way to get the MIME extension of a file_column field?
Here''s what I want to do (look for comment in before_save method):
class ProductFile < ActiveRecord::Base
belongs_to :product
file_column :file_name
def before_save
self.file_type = # something that returns the MIME type (e.g. image/jpeg)
end
end
TIA
2008 Jun 29
3
Working around/with Restful Authentication
I''m using Restful Authentication, and the code to create a user is
pretty straight forward - there is a before_save action and a
before_create action:
before_save :encrypt_password
before_create :make_activation_code
But for some reason when I try to create a user programmatically in
the controller like this:
User.new(:email =>
2008 Mar 18
0
Major issues with ActiveRecord callbacks in BackgroundRb r324
Hi there
I''ve been running BackgroundRb in production for a few months now. Recently
we added encryption onto some of our ActiveRecord fields by hooking in the
before_save and after_save callbacks, like:
class MyCallback
def initialize(attr_names)
@attr_names = attr_names
end
def before_save(model)
@attr_names.each do |attr_name|
next if
2008 Jan 02
0
why does rails keep prompting me for post?
Hi, was tryin to do a restful method to allow users to change
password.
This is what i did:
1) use restful authentication plugin.
2) use the code here http://www.railslodge.com/plugins/75-restful-authentication/documentations/1-change-password
3) realise that
no1. i am using something funny like /v1/users/:permalink/
change_password and not just /change_password
no2. i cant use html.erb for
2014 Oct 18
1
last_login plugin with MySQL
Hi,
I have a Dovecot test installation with MySQL userbase and authentication where
I am trying to setup last_login plugin with SQL dictionary
I read http://wiki2.dovecot.org/Plugins/LastLogin and I addes this to my
configuration
plugin {
last_login_dict = sql:/etc/dovecot/dovecot-sql.conf.ext
}
mail_plugins = $mail_plugins stats
protocol imap {
mail_plugins = $mail_plugins imap_stats
2009 Feb 07
5
before_save :strip_whitespace => saves with spaces
i used this private function for removing leading and trailing white
spaces from the values.that below function would be called before_save.
when i print the value after it strips.it prints string without any
spaces.but in the table fields it saves with spaces .
waht would be the problem.pls help me
class CompanyInfo < ActiveRecord::Base
before_save :strip_whitespace
def strip_whitespace
2006 Mar 24
2
Access to session data
Greetings,
This, I hope, is a simply answered question.
Based on Agile Web Development with Rails (depot application), I''m
developing a single table application for contact info. There is only
an admin side to this, so there''s always authentication.
Part of the info record (member) is changed_by and changed_at which I
automatically want updated. Changed_at looks after
2011 Jan 24
2
Seeing what has changed in ActiveRecord
I have a callback (before_save) that I want to trigger only when
certain fields within a record have changed. For example given a user
record with ''username'', ''password'' and ''date_of_birth'' I would like
the callback to do something only when the ''username'' or ''password''
changes or when the
2007 Apr 04
0
Voicemail to Text Transcription(was: Re: [asterisk-dev] Voicemail to text translation)
(This subthread is more appropriate to -users than to -dev, so it is
crossposted only to mark its transition. Please reply on the -user list
only.)
What are the cheapest prices for (humans) transcribing voicemail to
text as a service? The absolute cheapest, regardless of (known) quality
- the quality only has to compete with (cheaper) automated
transcription, which is abysmal quality.
On Wed,
2007 Apr 20
1
Voicemail to Text Transcription(was: Re: [asterisk-dev] Voicemailto text translation)
(This subthread is more appropriate to -users than to -dev, so it is
crossposted only to mark its transition. Please reply on the -user list
only.)
What are the cheapest prices for (humans) transcribing voicemail to
text as a service? The absolute cheapest, regardless of (known) quality
- the quality only has to compete with (cheaper) automated
transcription, which is abysmal quality.
On Wed,