Displaying 20 results from an estimated 200 matches similar to: "How can I intercept attribute calls?"
2005 Dec 31
6
habtm recursion via destroy_without_callbacks
I am having a problem with two models that each have a HABTM
relationship to the other. For example:
CREATE TABLE people (id INT, name TEXT);
CREATE TABLE teams (id INT, name TEXT);
CREATE TABLE people_teams (person_id INT, team_id INT);
The person model has:
has_and_belongs_to_many :teams
And the team model has:
has_and_belongs_to_many :people
The trouble comes when trying to destroy
2006 Jun 01
1
Automatted Getter/Setter
Hey..
So I have a model that has a lot of number fields. Each of these go
through a process when read in and read out to add/remove commas
(between every three numbers) to make them more readable.
The getter I currently have is like this:
def sale_price
Listing.insert_commas(read_attribte (:sale_price))
end
and the setter is:
def sale_price=(price)
write_attribute(:saleprice,
2006 Mar 23
2
rails 1.1 and mysql errors
Hi,
I just upgraded to rails 1.1 this morning and i am getting a variety of
errors from tests that were passing effortlessly on the previous edge
release (i froze several weeks ago, so I not sure what version that was).
Has anyone else experienced these types errors with the new rails:
I have several errors that are grouped around create and destroy commands
the errors are similar, first the
2008 Dec 19
5
paperclip
anyone can help me to use paperclip plugins..I have a problem using it.
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from
2006 Jul 27
9
Introspecting validates_presence_of
Hello people,
I''d like to detect whether an attribute of a model has
vaildates_presence_of applied to it so I can automatically apply a
mandatory (*) to the field...it doesn''t look easy...any ideas?
Cheers,
--
Dan Webb
http://www.danwebb.net
2009 Apr 02
3
convert to rails
how to convert this on rails
<!--[if lt IE 7]>
<script type="text/javascript" src="example.js"></script>
<![endif]-->
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group,
2004 Aug 21
2
Problems with Version 2.0.7 and Fedora 2
Hi!, I have Fedora 2 installed (Kernel 2.6), 3 interfaces (eth0,eth1,eth2), in the eth1 i have my local network and eth0 the Internet conection, when i do masquerading (eth1 out by eth0) only works for a few minutes. I dont know what i?m doing wrong, or only is an incompability or error between the OS Fedora 2 and the shorewall 2.0.7...i restart the shorewall service ones works anothers doesnt.
2004 Sep 07
1
Problem with DNAT
Hi
I have this configuration:
eth0 Link encap:Ethernet HWaddr 00:C0:F0:54:DC:1E
inet addr:10.10.10.166 Bcast:10.10.10.167 Mask:255.255.255.248
inet6 addr: fe80::2c0:f0ff:fe54:dc1e/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1738708 errors:0 dropped:0 overruns:0 frame:0
TX packets:1538724 errors:0 dropped:0
2004 Sep 07
1
Problem with DNAT 3 IP''s two NIC
Thanks Tom
Sorry, I was wrong, this is the correct question...
I have this configuration:
|
Email Server 192.168.0.253 |
___|___ Port 25 SMTP ___|____ ____
| LAN |-------------------------------------Eth1
2002 Jun 07
0
smbd: Too many open files
Hi all,
can any help with our strong problem:
we are using Samba on Linux as fileserver for Win2k clients running CAD software
"Solid Edge". This program opens many files and on big projects freeze.
We tried configuration:
- samba 2.2.3a or 2.2.4
- RH 7.2 or 7.3; kernel 2.4.18, 2.4.19 up to -pre10-ac2
- i686/1GHz CPU, 512 MB RAM
- "/proc/sys/fs/file-max" from default 8192 up
2012 Jul 08
2
Is a directory
"The installer linux/syslinux expects an unmounted FAT* filesystem.
-Gene"
I confirmed I'm trying to target an unmounted fat32 partition. Still getting "Is a directory" error.
2006 Feb 06
7
Delaying initialization of associations until first access
Guys,
Say I have the following:
-----
class Person < ActiveRecord::Base
has_one :house
end
class House < ActiveRecord::Base
belongs_to :person
attr_accessor :color
end
-----
Then I have the following code:
-----
john = Person.new
john.house.color = "Blue"
john.save
-----
What I would like to have happen, is that on first call to john.house, if
house hadn''t been
2006 May 10
13
Issue in ActiveRecord generated reader methods
Hi all!
I have come into a strange issue in Rails that I am hoping someone
can shed some light.
To make a very long story short, I have been researching how to
override ActiveRecord::Base#read_attribute and write_attribute to
perform security checks at the model level (influenced by the
ModelSecurity generator). Shortly after implementing some code to
check this behavior, I began to
2006 Jun 21
8
Modifying Model Output
Hi!
I''m a very-very new Ruby-on-Rails user even if I have some experience
with other Languages (mostly PHP, so this is my first real
object-oriented language)
My problem, newbie-ish as it is, is the following: I have a model,
Article, that returns Articles from the DB. Now, when a certain field of
the model (the intro text) contains no data, I want to fill it with a
truncated
2006 May 09
11
model filter?
Hi All,
Is there a way to filter / modify the output of a model class before
it''s returned to controller/view that''s calling it?
Example: I have a field phone_number which I always want to preformat
using the number_to_phone() helper....
Any help is appriciated.
Thanks!
--
Posted via http://www.ruby-forum.com/.
2009 Oct 18
1
Asterisk+Sphinx4 for simple mobile phone <-> server speech recognition
Hello!
I need to:
1) call special number (or run special application) on mobile phone
2) establish connection between mobile phone and server
3) allow server to recognize spoken numbers (Polish language) and some other
control words
4) let the server to say some short answers (prerecorded in mp3) according
to some algorithm and recognized words
5) let the server to save little text file on its
2010 Jul 19
3
ActiveRecord override
Would really appreciate it if someone could tell me why this is happening:
I override ssn method of AR class so I can encrypt/decrypt to/from the db:
class Person < ActiveRecord::Base
def ssn=(value)
write_attribute(:borrower_ssn, Crypto.encrypt(self.encryption_key,
value))
write_attribute(:borrower_ssn_final_four, value[5,4])
end
def ssn
# this begin - rescue can be
2006 Jul 14
7
Form validation - keepin correct fields displayed on refresh
All,
I''m finally doing my first real form in Rails - the model object that
I''m entering information for has 8 validations so far.
If I type in good values for all the fields but one, I get the pretty
validation, and the nice field highlighting, but all of the fields are
cleared, forcing me to retype all of that info. That is a big drag.
Is there a standard way to get the
2006 Jul 28
0
reserved words
I''ve seen this topic has been discussed a couple of times. However, I''m
wondering if a method exists in rails to test a name against the reserved
words listed on the wiki?
Just wanted to check before I write this myself (and type in all of those
names -- including PostgreSQL).
To explain the application:
I''ve written a project that manages ldap data. On a fresh
2020 Aug 02
1
Fwd: 8.2.2004 Quick recovery and fix for unbootable machines with rescue disk
Hello all--
These instructions are somewhat OK but my messed up box is the only one
I've got basically to help with this problem.
Where can we find "correction" instructions using a "rescue" CD or flash
drive? I understand RedHat provided detailed instructions to supported
customers.
Thanks.
_______________________
Sent from MzK's phone.
---------- Forwarded message