similar to: Comparing field's old value to new value

Displaying 20 results from an estimated 2000 matches similar to: "Comparing field's old value to new value"

2006 Aug 09
7
function before_save
Hi everybody I would like a function as the "before_save" method in the model. But it must be the opposite. When I take out data from the database through the model, I want to call a function before the data are available in the controller. Can anyone help me? ---- >>>> thx <<<< ---- -- Posted via http://www.ruby-forum.com/.
2008 Jul 23
3
Validation method vs. After Save & Rollback
Hey Guys, Again, I am just learning Rails, so I am asking advice here. I have a model called Company which has many Owners. The Owners model indicates the name of the owner and their share (as a percentage) of the company. The total shares for any one company can not be more than 100%. So if I have 10 owners each with 10% of the company and I update one of the owners and set their share to 11%,
2006 Jun 21
3
[PLUG] new plugin, acts_as_modified
Nothing special, just my first plugin. it came out of a request I saw on the list from someone who wanted to be able to tell if a model''s attributes had changed prior to being saved. Well, this plugin does just that (at least I hope it does). http://rubyforge.org/projects/actsasmodified/ Please see the README for details. Constructive comments and criticisms are appreciated. Chris
2006 Apr 17
5
Finding out updated fields
Hi, When we update a record via an update form, is there an easy way to find out the fields that have been changed. If the update is successful, i want to display: The following fields have been changed: field-name = new-value ... Thanks, Lantis. -- Posted via http://www.ruby-forum.com/.
2011 Nov 29
7
gem for storing and tracking changes
Hi people I want to know which is the best gem or plug-in to store and track register changes for a rails 3.0.9 app Hope you can help me, thanks -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this
2006 Jun 26
1
plugin, acts_as_modified 1.1.2
After a couple of thoughtful comments, I''ve made changes to acts_as_modified plugin. It no longer relies on after_find and after_initialize, which were both causing performance issues. Please check it out and let me know what you think, where you might recommend improvements or additional features and what not. One feature I do have planned (again, thanks to comments), but
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/.
2006 Jul 05
2
Serialized object behaves weird
Hi! I got a class named EinsatzFilter which I serialized to session. Before saving to session it works afterwards I keep getting the message: "undefined method `to_s'' for #<Person:0x38c6ab8>". "Person" is a from ActiveRecord::Base inherited class. Code: class EinsatzFilter include ApplicationHelper attr_reader :personen, :monat, :projekte, :kunde
2007 Feb 14
5
FormTestHelper should change hidden fields
Railsoids: FormTestHelper rules. It tests your response.body form at the same time as it triggers your action, with all the parameters in that form. This obviously improves quality. But it took issue with this: submit_form ''validate_stuff'' do |form| form[''IBhidden''] = ''validate'' end The field IBhidden is a hidden field. To be
2006 Aug 11
1
after_initialize and after_save
Hello, I am still reading Agile Web Developer pdf, it says about after_initialize and after_find. There is a Joe asks part when I read that they are special, however I didn''t really get the idea, why they are. On rubyonrails.org in the manual there is some sort description about their speciality, however their full descriptions are missing. What are the difference between
2005 Dec 28
4
undefined method `include''
I''m getting this error in Rails: undefined method `include'' for #<MenusController:0x408efd1c> The offending code is: require "rexml/document" include REXML I see there may be a problem with GCC 4 on OSX, but I''m using Redhat with GCC 3.2. http://weblog.rubyonrails.org/articles/2005/12/22/is-gcc-4-0-incompatible-with-ruby-on-os-x-and-elsewhere
2006 Jul 07
4
Calling a method each time an ActiveRecord Object is accessd
Hi, I know that it is possible to execute code each time data is saved into a model by using the +validate+ method. However, is there also a way to execute code each time the data is accessed, not just when it is changed? Bye, Winsmith -- Posted via http://www.ruby-forum.com/.
2006 Apr 03
1
Why no call to Model.new on find?
I created a model with some internal state derived from a combination of database and non-database data. Since I wanted to calculate these values once rather than every time they''re requested by the view, I calculated them in the initialize method and set some instance variables. However, I soon noticed that these values weren''t getting set when I retrieved data using the
2006 Feb 13
2
categories and admin/categories - different controllers and templates?
Is there some way to have these two sets of URLs use totally different controllers and templates? categories/list categories/show/1 admin/categories/list admin/categories/edit/1 admin/categories/destroy/1 admin/categories/update/1 Besides, of course, using different controller names ;). The first URL is publicly accessible, while the second contains admin functions. Also, with the second,
2006 Feb 04
4
Page caching feeds and cache file extensions
I have a feeds controller which generates RSS and Atom pages. I put ''caches_page :show'' in it. The problem is that the pages are saved with an html extension. As a result, browsers display the cached feeds as HTML rather than XML, and feed validators complain. There''s an option to set ''Base.page_cache_extension'' globally, but I don''t want
2007 Dec 16
4
Make AR setter methods private?
Hi, I have a AR model that I want to limit changes to be only via instance methods that I''ve added. How do I prevent my other sw from setting the instance''s attributes? I know about #attr_protected and #attr_readonly. But the first leaves the individual setters as they were and the second stops all changes. I want something like "attr_private" Thoughts? Thanks,
2009 Jul 01
2
[LLVMdev] build failure on ARM linux
llvm/lib/System/Atomic.cpp contains the call to __sync_val_compare_and_swap that lowers to the missing __sync_val_compare_and_swap_4 GCC intrinsic. The same file contains several other __sync_* calls and all these has to be implemented if we want to be able to compile llvm on linux/ARM with GCC versions below < 4.4 xerxes at labbserver:~/llvm$ grep _sync lib/*/* lib/System/Atomic.cpp:
2005 Nov 06
11
Ideal Rails / Apache config?
Hi All, Just about to set up RoR on our server and was wondering what the ideal setup for RoR is these days? Apache 1? Apache 2? fCgi? Any guidance would be helpful! Thanks, -Adam
2006 Jan 11
2
map.connect - redirect with 302?
Is it possible to write map.connect rules in route.rb that externally redirect (HTTP 302) to other actions? thanks csn __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
2009 Jun 30
0
[LLVMdev] build failure on ARM linux
Nick Lewycky wrote: > 2009/6/30 Andrew Haley <aph at redhat.com <mailto:aph at redhat.com>> > > Nick Lewycky wrote: > > I'm seeing this new build failure, starting some time yesterday on > ARM: > > Yes. It's just a matter of defining __sync_val_compare_and_swap_4: > >