similar to: detecting acts_as_x?

Displaying 20 results from an estimated 10000 matches similar to: "detecting acts_as_x?"

2007 Nov 27
1
Plugin - How to access object from instance method
Quick question: Given a basic plugin... how can I access an object that I instantiated in the acts_as method from an instance method? Probably some sort of accessor... but where? def self.included(base) base.extend ClassMethods end module ClassMethods def acts_as_test object = Object.new ## This object needs to be accessible from the Instance Methods end include
2008 Jan 22
11
Unable to load Models which reference plugins?
I''m using a plugin which adds a method to ActiveRecord::Base http://similetimelinerailshelper.googlecode.com/svn/trunk/simile_timeline/ This adds an "acts_as" type declaration to the Models, via the file in vendor/plugins/simile_timeline/lib/simile_timeline.rb Rails is working with these declarations, and they are being used successfully in ''regular
2006 Apr 30
4
acts_as_ordered_tree
I need an ordered (sortable tree) and I just was thinking if somehting like this is possible: class Item< ActiveRecord::Base acts_as_tree :order => "position" acts_as_list :scope => ''parent_id = #{self.id}'' end For my understanding mixing of two acts_as should be p?ssible, at least in this case, right? Unfortunatly the :scope is not working, I am not
2006 Dec 31
1
How do you use acts_as_ferret without rails?
I am currently using activerecord without rails and I''d like to use the acts_as_ferret plugin as it works well with activerecord. How do I take advantage of the acts_as_ferret without rails installed? Is this possible? If someone could provide me with direction on how this would be done, that would be greatly appreciated. I assume that since active record works without rails that all
2006 Nov 27
2
find_conditions in acts_as_ferret find_by_contents
Hi all, Every time I try to add options for the find_conditions argument of find_by_contents I get the following: a = AnnotatedLink.find_by_contents(''test'', {}, {:conditions => ''category_id IS NOT NULL''}) >> NoMethodError: You have a nil object when you didn''t expect it! You might have expected an instance of Array. The error occured while
2006 Jul 04
4
Question about Salted Hash Login Generator
Hi, I am using salted hash login generator to create my login page. In the user_environment.rb file, I saw that there is a comment saying should NOT include the email field in the changeable user fields array. Does anyone know why? > # Add all changeable user fields to this array. > # They will then be able to be edited from the edit action. You > # should NOT include the
2006 Apr 11
1
acts_as ... hourly_list?
Hi, My question is a bit of wonder and a bit of enlightment. I have two models, Channel and ChannelItem, the second is a list of Events, ordered by position (because I''m using acts_as_list). Later I use a method in Channel to recalculate the hour when that show come online, based on the duration of it and doing math based on the previous one duration and start time, starting from
2009 Sep 11
0
Need help with extending a plugin
hey folks I''ve installed the plugin acts_as_taggable_on_steroids (henceforth aatos), and i already have some tagging functionality set up, using the same approach (ie a Tag and a Tagging class with associated tables) as aatos. So, i want my existing Tag and Taggings methods, plus some other methods i have in a module which i include with the taggable classes (ie the ones that would call
2012 Apr 05
0
Polymorphism, acts_as_relation gem and nested attributes
I have the following polymorphic association set up with acts_as_relation (https://github.com/hzamani/acts_as_relation) Model code: class Email < ActiveRecord::Base belongs_to :detail validates_presence_of :address end class Detail < ActiveRecord::Base acts_as_superclass has_many :emails accepts_nested_attributes_for :emails, allow_destroy: true
2005 Oct 31
0
introducing acts_as_shellable gem
Hi all, I''m happy to announce a new acts_as gem, acts_as_shellable. If you find yourself constantly using script/console or another shell interface to rails, then this gem''s for you. This gem''s homepage is at http://www.chwhat.com/projects/shellable The docs are at http://chwhat.com/projects/shellable/doc/index.html You can install the gem the rubygem way:
2008 Oct 18
0
Passenger won't allow ActiveRecord to be extended ?
After much tinkering, I have discovered that any module or plugin which extends ActiveRecord causes Passenger to fail (application won''t load at all). Is this a known behavior? I have confirmed that my Passenger installation is working just fine with a simple Rails application that does not modify AR. Passenger 2.0.3 OS X 10.5.4 Built-in Apache 2.2 ruby 1.8.6(114) Rails 1.2.6 In one
2008 Feb 22
7
undefined local variable or method "acts_as_list"?
Hi, I''m getting the error below, and I''m not sure where to find "acts_as_list" ... NameError in SpecialsController#printer undefined local variable or method `acts_as_list'' for #<Class: 0xb7a46994> RAILS_ROOT: /usr/local/apache2/htdocs/dps Application Trace | Framework Trace | Full Trace vendor/plugins/trunk/lib/scope_out.rb:70:in
2006 Dec 11
1
Using Rails Plugins with Camping
I just picked up Camping and I''m currently reviewing every little tidbit of information I can find out about it. I really liked the simplicity of RubyOnRails, but sometimes you want something fast and everything is relative. After looking at Camping, RubyOnRails seems like a lot of work if you just want to test out a prototype of a small web app. One thing I do miss are all the
2006 Jul 26
13
tweaking minimum word length?
Hi, Can Ferret be configured to change the minimum word length of what it indexes? Right now it seems to drop words 3 characters or less, but I''d like to include words going down to 2 characters. How would I do that? Francis
2006 May 04
2
Enterprise Database Tier (XA transactions, COBRA and MIDAS)
I am developing a large scale financial application which is going to be very intensive write-wise, and use a lot of transactions. I can see how the the web and application servers can be scaled and load balanced quite easily, but not the database tier. The setups I have looked at so far seem to deal with coping with a lot of reads, and minimal writes - this maybe because they are largely
2009 Mar 24
12
MonkeyPatching ActiveRecord::Base class
I am trying to monkey-patch the ActiveRecord::Base class to incorporate a generic search class method so that it can be used by all model classes which need this functionality. Since model classes directly inherit from ActiveRecord::Base and unlike controllers and helpers, do not have an ancestor class defined, I think I am forced to open the ActiveRecord::Base class and patch it? May be I am
2011 May 01
2
More detailed Test::Unit error report
Hi, I''m starting to use Test::Unit to create unit tests for my Rails Applications/Plugins. I don''t have much experience in Ruby Unit Testing. The problem is that the output report is very simple and it is very difficult to discover where is the error. Test::Unit does not show the line number of the error and the Stack Trace printed using the --trace option does not help either.
2006 Jun 30
0
Three ActiveRecord features we want at work - any comments/suggestions?
Hi I thought I would run this past the Rails list before I start doing any work because I don''t want to re-invent any wheels. Basically the situation I''m in is that I work for a company that is currently working on two big non-Rails projects used for financial purposes (one sells vehicles and vehicle finance, the other is an internal broker management system used by
2006 Mar 02
3
Modifying "Find" to always add a condition?
I''d like to always add a condition to any version of "find" (e.g. Thing.find(), Thing.find_by_name(), Thing.find_by_whatever) so that in addition to whatever conditions are set, an additional condition is set :conditions=>"user_id=#{current_user.id}" I''d like to make sure that a user only sees/edits/creates entries in the database that have the user_id
2006 Apr 18
4
The two methods of handling deleted records. Standards?
Hi all, I am fiddling with a table of mine where I have chosen to use a column for tracking whether the row is deleted or not. If I chose the normal method of physically deleting the rows then everything is fine. But, since I am now using this alternative method I have to change a lot of code to make it work "out of the box", by adding :constraints clauses here and there. Also I have to