Displaying 20 results from an estimated 3000 matches similar to: "act_as_versioned and join tables?"
2006 Jun 10
4
using STI in a migration
I have some classes in my model which use STI and they work as expected
in the console. However, when I try to use them in a migration, I get
"uninitialized constant OfficePhone", for example. Why doesn''t the
migration environment pick up the class defs? OfficePhone is defined in
the model/phone.rb. I put model :phone in the application.rb but my
migration just
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 Mar 16
10
Nubee Callbacks problem
I never want to alter a model(row). When a model has been changed i
want a new copy to be created.
What is the best way to implement this?
I think using callbacks might be the answer.
So model.save will create a new row, and leave the old one unchanged.
Any ideas? I can easily implement this in the controller but i''d rather
it be done transparently. Also errors should be passed back
2006 Jun 08
0
acts_as_versioned_association plugin
Building on the great ''acts_as_versioned'' plugin by technoweenie, I''ve
written a small plugin which also stores versions of associations.
It''s early and experimental at the moment, but does work.
For example:
class Article < ActiveRecord::Base
has_many :images
has_and_belongs_to_many :categories
acts_as_versioned
acts_as_versioned_association
2006 Feb 14
10
acts_as_versioned and getting authors
Hey guys and gals,
I have the following object that has acts_as_versioned:
class Note < ActiveRecord::Base
acts_as_versioned
belongs_to :user
end
The schema for my notes table is as follows:
create_table :notes, :force => true do |t|
t.column :id, :integer
t.column :noteshare_id, :integer
t.column :user_id, :integer
t.column :title, :string
2006 Feb 17
2
acts_as_versioned and acts_as_taggable on same model?
I am trying to use acts_as_versioned and acts_as_taggable (plugin) on
the exact same model. Has anyone successfuly done this? I think
what I need to do is make model_versions acts_as_taggable instead of
my main model. Anyone have any other suggestions or any suggestions
how to do this?
Your Friend,
John Kopanas
http://www.kopanas.com
2006 Dec 05
7
Dynamic # of Attributes for a Model (key/val table) Get/Set?
I''m working on a simple product catalog. Products have user defined
attributes, such as: color, size, weight. More attributes can be added
at any time. Since these attributes are not known ahead of time, they
cannot be created as columns.
My table structure (simplified):
products
--------
id
name
attrs
--------
id
name
product_attrs
--------
id
attr_id
value
And some sample code:
##
2006 Jan 30
5
a RJS problem/patch
Hi,
add_rjs_to_action_view.rb of javascript_generator_templates
doesn''t work with setting Content-Type in a controller.
(e.g.) http://wiki.rubyonrails.org/rails/pages/HowtoSetDefaultEncoding
class ApplicationController < ActionController::Base
before_filter :set_charset
def set_charset
@headers["Content-Type"] = "text/html; charset=utf-8"
end
end
I
2005 Jul 26
6
implement audit trail table
has anyone has any idea how to implement audit trail table for all update /
deletion done on records?
I''m thinking to have corresponding audit trail table to each table, so
everthing before an update or deletion is done, a new record will be insert
into the corresponding audit trail table.
Is there a way to overwrite the save, destroy, method at the application
level? so that I do not
2006 Feb 22
5
Auditing mixin for model classes. Small problem
I want to include common auditing functionality in my models. This
involves storing the changes made to a model in a seperate table :
I have created the functions in an Audit module :
module Audit
before_update :before_changes
after_update :after_changes
def before_changes
old=self.class.find(id).attributes
@changes=[]
attributes.each do |key, val|
if val != old[key]
2006 Mar 22
15
Rails-1.1.0-RC1 tagged today (4010)
Looks like Rails 1.1.0 RC1 is finally here:
http://dev.rubyonrails.org/changeset/4010
--
Posted via http://www.ruby-forum.com/.
2006 Mar 06
1
Model for Tracking changes
Hi!
I''m new to Rails (and ruby in general). I was planning to implement a
whiteboard like system, in which changes made by users to the board are
automatically tracked.
Currently, I''ve implemented it as a model Post which :has_many Boards. A
new Board is added to the Post every time a change is submitted (with a
created_at timestamp). This allows saving multiple versions of
2006 Jun 12
5
railish icons?
This is a little off topic but someone here knows, I''m sure... Does
anyone have a good site to find freely available standard icons for
things like add/edit/delete/save?
I''m looking for a set of clean and simple matching icons that capture
that Railsy-Web 2.0 feel...
Maybe icons aren''t Railsy...
Steven
--
Posted via http://www.ruby-forum.com/.
2006 Apr 13
2
acts_as_versioned gem
I''ve installed the acts_as_versioned gem, and it shows up as
installed when i do a "gem list"
After installing it, I set up my new model with the
"acts_as_versioned" line in its model file. I think went to run my
migration to create this table, and I got the following error:
== CreateDpslevels: migrating
================================================
--
2006 Aug 13
0
Major update to acts_as_versioned_association
I''ve spent the weekend giving my acts_as_versioned_association (or
version_association for short now!) some much needed attention.
Unit tests have gone from a shameful 150 lines to well over 700 now -
around 1:3.5 code to test ratio. There''s still probably a lot which
needs testing, but it should be a lot better now.
It''s a fairly major update and there are some
2006 Jan 16
16
acts_as_authenticated current_user in a model?
What do I need to do to be able to use an acts_as_authenticated
current_user in a model?
Is there some sort of include or require I can do some where that would
allow this?
**********************************************************
Here is what I am trying to do:
**********************************************************
class Setting < ActiveRecord::Base
before_create :created_by_user #
2006 Mar 20
3
help: acts_as_versioned setup error "undefined local variable or method ''base_class''"
Hi All,
Rails newbie here trying to set up acts_as_versioned according to Chapter 14
in the Rails Recipies book. I''ve taken the following steps (nearly
verbatim) as mentioned by the book:
- created the target model "Post"
- added the "acts_as_versioned" label to the model file
- generated a migration file
- added the table creation code and the command
2006 Feb 20
3
file_column and login_engine incompatibilities
Hi, has anyone come across any incompatibilities between file_column and
login_engine?
I''ve been having strange issues where a User model with file_column in
it is failing to save the images properly. Everything uploads to the tmp
dir fine, but then it never gets copied to the proper permanent location.
No errors - everything happens fine except for that final part.
I have
2006 Apr 07
2
weird error with rake create_sessions_table
Hi all,
Despite switching to mod_fcgid (which has improved performance),
sessions are still expiring sporadically. I thought I might try
switching to storing them in the db, but I get the following error when
I try to run the rake create_sessions_table command
D:\User\Code\ruby\prometheus>rake create_sessions_table
(in D:/User/Code/ruby/prometheus)
rake aborted!
undefined local variable or
2005 Aug 15
5
Customized Autocompletion
In the customized autocomplete demo, how does it know what content to
use as the value of the autocomplete?
The returned UL has the name, email address and an image. Yet only the
name is used.
How does it do this? I''ve been trying to get something similar going all
morning with little success.
Also, what does :skip_style=>true do? I couldn''t seem to find a mention
of it