similar to: How To write an acts_as* plugin

Displaying 20 results from an estimated 100 matches similar to: "How To write an acts_as* plugin"

2006 Jan 27
4
plugin install behind corporate firewall?
Hi all, Anybody has a clue on how to install a plugin behind a corporate firewall? I know the "-p" option works for installing a ruby gem thru a proxy, but it doesn''t seem to work for script/plugin install Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL:
2006 Oct 10
6
"MySQL server has gone away" with Apache 2.2 + Mongrel cluster
Hi I just setup a server (Apache 2.2, mod_proxy_balancer, mongrel_cluster) with 2 Rails applications according to this excellent Post: http://blog.codahale.com/2006/06/19/time-for-a-grown-up-server-rails-mongrel-apache-capistrano-and-you Everythings works great, but after a long inactive period (say one night), the first 3 connections allways get an Error 500 Excerpt from production.log: ...
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
2005 Nov 04
0
after_find callback in an acts_as plugin
Hi, I am thinking about writing an acts_as_fox plugin that defines an after_find callback method. If I do this what will happen if a user creates a model that acts_as_fox but this model has it''s own after_find callback method? I imagine that the model''s after_find method shadows the plugin''s after_find. Presumably both after_find callbacks would need to be performed but
2012 Oct 04
0
acts_as tree, nested_set, something custom? Which would be best for my situation?
I''m creating a hierarchical tag structure for my portfolio. I have a few top level tags. those could then have children, those children could then have children. Pretty standard so far. Often a child tag will be under more than one parent (i.e. a child might belong toone or more parents) and it wouldn''t necessarily have the same children under one parent as it would in another.
2012 Aug 03
1
Mock_model not recognizing act_as_mappable
I am using mock_model in my tests, and I encountered a situation where my stub is failing. Here''s the scenario: Controller: @locations = Location.al(:bounds=>bounds)l @locations.sort_by_distance_from([bounds.center.lat,bounds.center.lng]) Rspec: @location = mock_model(Location) Location.stub(:all).and_return([@location])
2005 Dec 02
43
ANN: acts_as_ferret
Hi all This week I have worked with Rails and Ferret to test Ferrets (and Lucenes) capabilities. I decided to make a mixin for ActiveRecord as it seemed the simplest possible solution and I ended up making this into a plugin. For more info on Ferret see: http://ferret.davebalmain.com/trac/ The plugin is functional but could easily be refined. Anyway I want to share it with you. Regard it as a
2005 Dec 02
43
ANN: acts_as_ferret
Hi all This week I have worked with Rails and Ferret to test Ferrets (and Lucenes) capabilities. I decided to make a mixin for ActiveRecord as it seemed the simplest possible solution and I ended up making this into a plugin. For more info on Ferret see: http://ferret.davebalmain.com/trac/ The plugin is functional but could easily be refined. Anyway I want to share it with you. Regard it as a
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
2007 Apr 20
2
Caching of database values
If do something like this: dbObj = MyTable.find_by_id(5) a = dbObj.name b = dbObj.name How many times will an SQL call be made to get the value of MyTable.name for id 5? In other words, are the values for dbObj cached in the object? Is there a way of controlling that? (I can imagine that sometimes you might not want to cache them if you wanted to be sure of having the latest
2006 Mar 22
10
Need for multiple acts_as_list
I have a model "Childmodel" that belongs_to two other models "Parent1" and "Parent2". "Parent1" "has_many :childmodels, :order => :positionp1" and "Parent2" "has_many :childmodels, :order => :positionp2". i.e. The child is independently positioned within each of its parents. This works fine and gets me the useful
2006 Jan 09
11
Scaleability and Sharing of code between apps
Application 1 is an auditing application called AuditSystem. Application 2 is a quality control appllication called QC. App1 has a couple of classes, including models, that i would like to use with App2. I would like a change in a class to be felt in both applications. How do i acheive this without copying and pasting code?? At the moment im feeling i should have made the whole thing one
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
2005 Nov 03
12
Installation of plugins/gems/mix-ins confusion
I''m running 0.14.2 and am a little confused as to the best way to install mix-ins. I''m specifically using "acts_as_paranoid" as an example (as it is one of the simpler implementations). It is a gem and can be "installed" as a gem, but then what''s the best way to integrate it into my app (require_gem?). I''ve seen recommendations to require it
2009 Feb 26
2
detecting acts_as_x?
I''m writing an acts_as_x type plugin/gem and I need to know how to detect which other acts_as plugins are installed so I can avoid name conflicts. What''s a simple way to do this? Thanks John Small -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby
2006 Jul 28
12
MenuEngine
Hi all, MenuEngine is a small Rails engine that can generate templated drop-down DHTML menus commonly used for web site navigation. Supports creation of menus from a YAML file, from code and from pre-configured HTML. Optionally integrates with UserEngine for authorization. http://www.muermann.org/ruby/menu_engine Project page: http://rubyforge.org/projects/menuengine This is my first attempt
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
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