similar to: Modifying data before update or save

Displaying 20 results from an estimated 4000 matches similar to: "Modifying data before update or save"

2008 Jul 10
6
Uppercase all row columns
Hi. I have to convert the contents of all columns to uppercase before creating a row. Is there an easy way to accomplish this so I don''t have to go one column at a time and upcase! it? Thanks. Pepe --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group,
2007 May 21
7
How do I stop a column being updated by model.save?
One of my models has a column that is updated very frequently from a separate process, so it is important that when a record is saved in rails, this column should be left alone. In the update method of the controller I have: @record = MyModel.find(params[:id]) @record.update_attributes(params[:my_model]) params[:my_model] doesn''t have a reference to the column I''m talking
2006 Jul 07
7
Sequencing control with edit method in CRUD examples
I have been playing with the cookbook type of tutorials building a fish tournament scoring piece and am having a bit of a problem with a DB field called "points" in my "catch" table that is not input by the user but is calulated based on a "size" field that is input by the user. I have the following in my catch_controller.db def new @catch = Catch.new @fish =
2012 Jun 14
1
facter --yaml leaves some fields blank
Sometimes "facter --yaml" doesn''t list all the values specified on the command line. I can''t find rhyme nor reason why. Here''s a demo to show what I mean: # facter --version 1.5.7 # facter --yaml fqdn macaddress lsbdistcodename --- fqdn: my.host.name.example.com lsbdistcodename: squeeze macaddress: "00:00:00:00:00:00" We had been using the above
2006 Jan 13
2
Change Password with acts_as_authenticated
I want to have a form to change a users password. I can''t figure out what the method in the controller should look like. I tried @user.save and @user.update_attributes, but can''t get it to work. My Form: ############################## <%= start_form_tag :action => "update_password", :id => @user.id %> <%= password_field ("user",
2005 Dec 28
2
form reset after successful form submission
hi, what''s the way to reset the form generated by the form_remote_tag after the successful submission of the form? thanks
2018 Sep 10
4
schema enhancement recommandation?
Hi Rowland, thank you for your fast answer. More see below. On 10.09.2018 19:18, Rowland Penny via samba wrote: > [..] ERR: Object class violation : "objectclass_attrs: attribute >> 'macAddress' on entry 'CN=DEMO-02,CN=Computers,DC=dmiserver,DC=lan' >> does not exist in the specified objectclasses!" on DN >>
2005 Dec 15
10
.rpdf ?
I haven''t delved into the wonderful world of PDF::Writer yet, nor have I run across a need.. but I just had an idea I wanted to throw out there how hard would it be to create a .rpdf template plugin for rails? could be neat ;]
2011 Oct 12
1
scopes related question
Hello, Have a question related scope definition. I need to define a scope based on related model attribute values like this. class Product < ActiveRecord::Base belongs_to :currency scope :with_currency, lambda { |currency| unless currency.to_s.upcase == ''ALL'' # here I need to define a scope that would test for currency.char_code to match a passed value # something
2012 May 12
12
before_save messing up
#user.rb ------> Model class User < ActiveRecord::Base attr_accessible :email, :name, :password, :password_confirmation has_secure_password before_save :create_remember_token . . . . . . . private def create_remember_token self.remember_token = SecureRandom.urlsafe_base64 end end #sessions_controller.rb ------->
2019 Mar 18
2
How to automatically store the macAddress in AD
On Mon, 18 Mar 2019 09:16:01 +0100 Denis Cardon via samba <samba at lists.samba.org> wrote: > Hi Pierre, > > > Does someone know a way to automatically store the hwaddress in the > > AD? I'm using Veyon in my school to manage the students PCs and if > > the hwadress is populated in the AD, the Room configuration can be > > set with AD otherwise i have to
2017 Mar 26
2
Systemd interface rename does not work
Hi, I'm moving to Systemd for my network management but I don't see my link name changed when I try to using a .link name. The .network file works right, networkmanager is removed as well to accomplish this. Any idea why the rename is not done ? /etc/systemd/network/0-eth.network [Match] MACAddress=00:1a:4a:a9:0a:17 [Network] Address=172.16.3.141/24 Gateway=172.16.3.254
2010 Aug 18
2
[PATCH] Don't show vlan interfaces in NIC host management
Signed-off-by: Arthur Clement <aclement at linagora.com> --- src/host-browser/host-register.rb | 16 ++++++++++++---- 1 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/host-browser/host-register.rb b/src/host-browser/host-register.rb index 693a6f2..5ff6a90 100755 --- a/src/host-browser/host-register.rb +++ b/src/host-browser/host-register.rb @@ -393,13 +393,18 @@ class
2007 Feb 06
3
Question on case statements...
Just poking around on the Docs site and went to the facter recipe for VMware. (http://reductivelabs.com/trac/puppet/wiki/IsVmwareGuestRecipe) If you look at the bottom, the author states that they were unable to get case statements to match as a regex. case $macaddress { "00:0C:29:*":{ file{ "/etc/running_inside_vmware": ensure => present } } }
2018 Sep 10
2
schema enhancement recommandation?
Hi list, Im using Samba 4.x (x >=8) and Im excited about the new "samba-tool computer" simplification of computer managment in AD mode. Now I would like to use some more information tags  in the computer section, i.e. partition information or macadress of the nic. So I tried to enhance the schema (using 4.10.0pre1-GIT-8c00c017cb5) i.e. simple with >>> cat win.ldif dn:
2005 Dec 25
2
scriptaculous-js-1.5.0
I''m not a JavaScript guy, so please help me out. It''s my understanding that Rails 1.0 includes scriptaculous-js-1.5.0 But it seems to contain portions of, but not the complete library. Rails 1.0 includes 4 .js files, scriptaculous-js-1.5.0 includes 8. What am I missing? > tmornini$ rails --version > Rails 1.0.0 > > tmornini$ rails test | grep
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
2006 Apr 18
4
upcase special chars (åäöü...)?
Hey guys How do you upcase the special characters (????)? I use latin-1 and not utf-8. How did you solve this problem? (nice ruby way or ugly hack doesnt matter) Daniel -- Posted via http://www.ruby-forum.com/.
2019 Mar 20
1
How to automatically store the macAddress in AD
On Wed, 20 Mar 2019 14:40:22 +0100 "Pierre, BRIEC via samba" <samba at lists.samba.org> wrote: > Thanks Rowland for your modification. > > The process is working fine as the information is added but is wrong > > > the macaddress from DHCPREQUEST is 90:1b:0e:bb:12:8a > and the macaddress in AD is: 1:90:1b:e:bb:12:8a (have you noticed the > missing 0 and
2010 May 10
6
feedback on a few ActiveSupport::Multibyte patches
Hi all, In response to Rodrigo Rosas''s message about mb_chars.upcase not giving the expected result on 1.9, I''ve done some work in a fork to make String#mb_chars always return an instance of a proxy class, both with Ruby 1.8 and Ruby 1.9. The end result of the patch is (hopefully) to make Rails'' multibyte functionality behave the same way in 1.8.7 and 1.9.x.