Displaying 20 results from an estimated 100 matches similar to: ""include" versus "extend" - what's the difference"
2013 Mar 21
0
how to remove changed_attributes from yaml response
Hi,
I am using attr_accessor attributes in model class and assigning the
values to attr_accessor dynamically in controller. And am sending the
data object to display in Yaml format. I am getting the response along
with changed_attributes but I don''t want changed_attributes details in
my response.
build Model code
class Test < ActiveRecord::Base
attr_accessor: t_1, t_2, t_3, t_4
end
2009 Nov 26
4
Is this a bug?
Hello all, while I''m using acts_as_audited(on jruby platform),
after vendored the acts_as_audited, it reports some error,
line 167,
# Start observing the declared classes and their subclasses.
def initialize
Set.new(observed_classes + observed_subclasses).each { |klass|
add_observer! klass } #this line
end
after some trace shows this one, when observed_classes is empty, will
2006 May 17
0
acts_as_versioned with lock_version bug?
Hello.
The acts_as_versioned plugin works fine ... till the adjunction
of optimistic locking via the lock_version table column.
Here is the problem description:
Without optimistic locking things are fine:
# ++++ The table creation migration ++++
% cat db/migrate/001_create_tables.rb
class CreateTables < ActiveRecord::Migration
def self.up
create_table :softwares,
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
2011 Jun 16
1
Deep cloning an ActiveRecord
I have a situation where I want to duplicate an ActiveRecord including
duplication of has_many relationships.
I''ve seen a few plugins but it seems unclear if they will work on
Rails3. So I was wondering if anyone has a good suggestion for a
plugin they are currently using to do this?
Basically I''m doing this because I have an object that I want to allow
my users to edit. I
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
2006 Aug 19
1
Re: DB Auditing
On Saturday 19 August 2006 11:25, Jeremy Cowgar wrote:
> A recent thread titled "DB record versioning/audit" made me post this
> message:
>
> I''ve created a plugin called "acts_as_logged".
There already is acts_as_audited.
Michael
--
Michael Schuerig
mailto:michael@schuerig.de
http://www.schuerig.de/michael/
2006 Apr 12
0
Netmask validator
Sharing the wealth. I just finished working on a custom netmask
validator and thought others might benefit. Of course, comments and
suggestions are welcome.
def validates_netmask(*attr_names)
configuration = { :only_numbers => ''must only use numbers as octet values'',
:range => ''has one or more octet values that are > 255'',
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/.
2010 Mar 23
0
Frozen hash problem
I''d like to delete some records before saving them. I ran this
experiment:
before_save :prune_lab_datas
def prune_lab_datas
lab_datas.each do |lab_data|
lab_data.destroy
end
raise lab_datas.to_yaml
end
But nothing seems to be deleted in the hash:
---
- &id001 !ruby/object:LabData
attributes:
created_at: 2010-03-21 22:16:06
unit_id: "3"
2007 Aug 18
0
RSpec and acts_as_attachment
Hey guys,
I''m getting a weird error when trying to test something like the
following. It''s a model that is using acts_as_attachment but the
weird thing is the equivalent Test::Unit case passes. Does anyone
have any ideas?
Best,
Dave
# it was a Test::Unit case first
def test_should_be_invalid_without_file
UserFile.any_instance.expects(:with_image).never
2006 Jul 26
1
AuditTrail in Rails
Hello there,
I need to build an audit trail system for an application. So far I have
been looking at acts_as_versioned and acts_as_versioned_association
plugins. I am having troubles getting the second one to work.
Any how, do you have any suggestions about how to build a robust audit
trail?
Thanks,
Roland
--
Posted via http://www.ruby-forum.com/.
2006 Dec 12
2
RXML partial question
All,
I have a RXML template which renders partial RXML templates within it.
A snippet is below. The "xml" variable is the parent template''s Builder
variable. It is passed into the partial under the name "parent_xml".
Why can''t I use :locals => {.... :xml => xml ....} in my call to render
the partial? It seems like if I do use :xml => xml, it
2009 Sep 23
5
Overriding AR read/write_attribute - Overridden write_attribute Is Never Called
Could someone explain this?
#config/initializers/ar_attributes.rb
module ActiveRecord
module AttributeMethods
alias_method :ar_read_attribute, :read_attribute
def read_attribute(attr_name)
p "read_override"
ar_read_attribute(attr_name)
end
alias_method :ar_write_attribute, :write_attribute
def write_attribute(attr_name, value)
2009 Aug 29
0
default_error_messages error with attachment_fu
Hi,
Just a newbie at Rails. Was looking at uploading images using
attachment_fu and RMagick on a Windows Vista machine, but was getting
this error. Any possible way of fixing this problem?
ActiveRecord::Errors.default_error_messages has been deprecated. Please
use I18n.translate(''activerecord.errors.messages'')
I guess it''s attributed to this line in attachment_fu.rb
2011 Sep 17
3
[PATCH 1/1] hivexml: Base64-encode non-printable data
Some of the data in names and string values were being unsafely printed,
causing some types of XML processors to fail (e.g. Python's Expat).
This patch checks for printability of each character and outputs base64
with an encoding attribute for unsafe data.
---
xml/hivexml.c | 75 ++++++++++++++++++++++++++++++++++++++++++++++++--------
1 files changed, 64 insertions(+), 11 deletions(-)
2005 Dec 30
5
HABTM with finder_sql problem (Rails bug?)
I''m building an app that needs i18n support across the entire database
(i.e. localized attributes). In order to do this I''ve created a
special HABTM join table that can be associated with _any_ other
table:
create table language_strings (
for_table varchar(255) not null,
foreign_id int not null,
language_id varchar(5) not null,
attr_name varchar(255) not null,
value text
2008 Jul 01
0
acts_as_audited on ActiveResource
I came across this awesome plugin used for auditing models. This is an
ActiveRecord extension. However I was wondering if I could tweak it a
little to make it work for ActiveResource.
In case you haven''t heard about acts_as_audited plugin, here is the
link to check it out.
http://opensoul.org/2006/07/21/acts_as_audited
Is there anyone who has experience in similar context? Please help!
2006 Oct 10
0
"acts_as_audited" - anyone have code for displaying the YAML stored audit-changes?
Hi,
Does anyone have the code to read in the activeRBAC changes (stored in yaml)
and display them in a view they could post? For a given record in the
audits table for example, and the yaml that is stored in the changes
column. I have read in the yaml from the changes column for a given audit
table entry, but just now wondering how to consume this and display it (my
first time with YAML)
2011 Oct 02
4
Aggregated attribute changed but _was is changed too. So nothing is update in database.
(Frenchy, sorry =) )
Hi everyone, i''ve got some troubles with aggregated attribute.
I created a point and path class which receive postgresql point and
path type data. Path object contains an array of point object.
I''m currently working on a "hunting" module in web browser based game,
and i need a crontab executed every n minutes to move the character on
the map.