On Fri, Feb 22, 2013 at 3:51 AM, javinto jan.javi...@gmail.com wrote:
Have you been looking at CanCan?
I've implemented a similar situation with CanCan. It will not cover your
needs for 100% but it will do a lot.
Yes I have been looking at cancan. I have also been looking at Consul.
Of the
I have the following scenario.
Users have various levels of ability. They can only view and edit
their own records (their profile). Their managers can only view and
edit their employees records. The regional managers can view and edit
only the people in their regions and the corporate
conn = ActiveRecord::Base.connection_pool.checkout
raw = conn.raw_connection
raw.exec(COPY tablename (col1, col2, col3) FROM STDIN)
# open up your CSV file looping through line by line and getting the line
into a format suitable for pg's COPY...
rc.put_copy_data line
# once all done...
I have done some googling to try and figure out how I can use COPY
FROM STDIN with rails and have ran into some posts on stackoverflow or
the mailing list but none of them seem to be working with rails 3.2
Does anybody have a working example of using COPY FROM STDIN?
Some things I have tried
Rubymine.
Has full support for git (and everything else you can think of)
On Fri, Nov 18, 2011 at 3:17 PM, Mathew S. li...@ruby-forum.com wrote:
Anything but Aptana Studio
I have not had good luck with Aptana... So Please give me a list of your
favs.
And how you would open up the
I'll bump this. I too am interested in getting minitest working
especially with autotest.
I kind of got something going but it's ugly and doesn't work with autotest.
On Thu, Oct 20, 2011 at 12:37 PM, djangst djan...@gmail.com wrote:
I'm looking for a simple way to integrate minitest/spec with
I want to create routes that map a subdomain to a controller. Each
controller will have the same actions but they will have different
views and will do different things. So basically I want something like
this imaginary route
constraints(app = App.new) do
controller app.controller do
I want to be able to specify something like this.
group :development do
gem 'mygem', :path = File.expand_path(File.dirname(__FILE__) + '/../mygem')
end
group :production do
gem 'bingatron-core', :git = g...@github.com:myaccount/mygem.git
end
Bundler doesn't like this at all and complains
I don't think so - I think activerecord is expecting to be able to
read the default values out of the database schema, although that
assumes that the default is some fixed value.
It should be possible to do something like this though, since updates
only write unchanged columns.
In postgres
Having a column called hash is weird - Object has a method called
hash, which your attribute will shadow, which could mess up trying to
call uniq on an array containing objects of your class
Fred
That was the case. Can't have a column called hash in your models.
You trip on the magic.
--
I am getting this error with a very simple model and schema. The
record saves even though an error has been generated. I have tried
this with both postgres and mysql.
Here is the model.
class Person ActiveRecord::Base
end
Here is a transcript..
p = Person.new
= #Person id: nil, hash: nil,
Has anybody ran into this error with rails and postgres? I get this
quite a bit and I have no idea why.
--
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@googlegroups.com.
To unsubscribe
I have a few dozen daemons and all of them load the rails environment.
Each one uses the DaemonSpawn gem to daemonize itself. I was
thinking that I could save a lot of memory if I could somehow share
the rails environment between all of these daemons. It seems to me
the simplest thing to do
I did a quick search for pentaho on the mailing list and a post came
up from 2008. Has anybody integrated pentaho with rails yet?
--
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
On Fri, Feb 11, 2011 at 4:40 PM, Tim Uckun timuc...@gmail.com wrote:
On Fri, Feb 11, 2011 at 4:38 PM, Jim Ruther Nill jvn...@gmail.com wrote:
I'm not sure but if you look at
http://api.rubyonrails.org/classes/ActiveRecord/NestedAttributes/ClassMethods.html
your params does not have the same
I am having a confounding issue and I hoping somebody can give me a
clue as to what is happening.
I have one field in my table which is not updating via the form. It
updates fine if I extract the information from the params and do it
manually in the controller. On this form the ebmedded form is
On Fri, Feb 11, 2011 at 4:07 PM, Jim Ruther Nill jvn...@gmail.com wrote:
i don't know if location is a special term or not. But I have a question, do
have an attr_accessible line in your user model?
If you do, check that you have the location attribute listed there.
DOH!. Yes that was the
On Fri, Feb 11, 2011 at 4:38 PM, Jim Ruther Nill jvn...@gmail.com wrote:
I'm not sure but if you look at
http://api.rubyonrails.org/classes/ActiveRecord/NestedAttributes/ClassMethods.html
your params does not have the same format as the one stated in the link. It
should be
When I call destoy_all on a model with a where clause AR iterates
though each record in the recordset and calls destroy on each item.
This seems highly inefficient to me. Wouldn't it be better to call
delete from child records where foreign_id in (parent ids)?
In other words shouldn't destroy all
No. Destroy has to instantiate each object prior to actually removing it
from the database in order to run any before/after destroy call backs.
You can speed things up if you don't need this by tweaking the :dependent
option to has_many so that it will simply use SQL's DELETE on the child
On Sun, Dec 19, 2010 at 7:26 PM, Jim Morris wolfma...@gmail.com wrote:
I've spent the day trying to track this down. I am not seeing it with
my older rails/activerecord app, only with the newer rails 3.0.3/
sequel app.
I am seeing it using activerecord on rails 3.0.3
The problem just occured
I suspect what is happening in my case, (and maybe yours), is the SSL
connection is renegotiating and failing, which is documented
elsewhere (google postgresql ssl renogotiation)
So far I have not seen this issue since I switched to a local
connection. Although I have two other older rails
On Sat, Dec 18, 2010 at 11:05 AM, Jim Morris wolfma...@gmail.com wrote:
I have recently deployed a similar setup, Ubuntu 10.04, pgsql 8.4,
rails 3.0.3, pg gem etc.
I have started to see this error occasionally, that request fails then
subsequent requests are OK, the pgsql log says the client
I have some daemons that connect to a PG database and are pretty busy.
Every few days at least one of them starts failing with this error.
PGError: lost synchronization with server: got message type something
Sometimes the message type is an empty string. Other times it's a
letter like E or
This problem started with the recent update to rails. I also think it
may have to do with this statement
ActiveRecord::Base.connection_pool.clear_stale_cached_connections!
The postgres mailing list tells me these errors have to do with
threading in libpq.
On Wed, Nov 3, 2010 at 11:41 AM, Tim
I am getting these types of errors quite frequently and am wondering
what may be causing them or how to fix them.
PGError: lost synchronization with server: got message type T,
length 1409286191
PGError: lost synchronization with server: got message type T,
length 1409286191
PGError: lost
Well it looks like the core issue is that HashWithIndifferentAccess
became ActiveSupport::HashWithIndifferentAccess in rails 3. The
session is a serialized ruby object which somewhere is saying that it
contains an instance of class ActiveSupport::HashWithIndifferentAccess
and rails 2 is
I'll give that a try and see if it works.
Another thing I noticed was that rails3 sets a 'session_id' and rails2
sets a :session_id
Just to follow up on this...
Your workaround worked but it only went so far. Now I am getting this error.
Session contains objects whose class definition
On Tue, Aug 24, 2010 at 7:04 AM, gkaykck gkay...@gmail.com wrote:
you should share some code here, there could be many reasons for that
Ok it's pretty simple.
In rails 2 app I have something like this.
Initializers session_store.rb
ActionController::Base.session_store = :cookie_store
Hey all.
I have two apps. One is a rails3 app and the other is a rails 2 app.
Using proxying I am routing actions in the myapp.com/foo to the rails2
app.
It almost works! I can set a session variable and a cookie variable on
the first app (myapp.com) and then read them on the second app
Can anybody confirm whether or not this has been fixed in the rc releases?
--
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-t...@googlegroups.com.
To unsubscribe from this group, send email
I am trying to test an action which is supposed to give a json
response The url goes something line /blah/model.json
When I POST to that URL using curl like this
curl -H Content-Type:application/json -H Accept:appn/json-d
data http://localhost:3000/blah/model.json it works just fine.
In
The @controller and @template are returning nil in rails3.
What is the proper way to refer to the current controller in rails3?
Cheers.
--
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
On Sat, Apr 10, 2010 at 4:48 AM, Julian Leviston jul...@coretech.net.au wrote:
http://code.google.com/webtoolkit/
It would be kind of cool if there was a version of this for ruby or jruby.
Just as an alternative to rails.
--
You received this message because you are subscribed to the Google
The only code I can see that affects triggers is in the original
PostgreSQLAdapter#disable_referential_integrity method. It disables
triggers during a block and re-enables them afterwards. As far as I
remember, this is used to load fixtures while temporarily suspending the
triggers. As
http://github.com/aeden/rails_sql_views/tree/master
and my heavily hacked version
http://github.com/mschuerig/rails_sql_views/tree/master
My version works with Rails 2.3.2, loads only the adapters that are
really needed, and adds ActiveRecord::View as an abstract superclass for
views
I fired up the debugger and watched the code happen tonight.
The problem occurs if the config.action_controller.perform_caching = true in
your environment. It's not set to true in development but it is set to true
in production and staging.
The problem occurs not in my controllers but in
Name the fixtures.yml file after the actual target table, not the view.
I'll give that a shot. Thanks...
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby
on Rails: Talk group.
To post to this group, send
Hello all.
I am having a hell of a problem and it's driving me nuts. I get the
following error (undefined method `controller_name' for nil:NilClass): but
only when config.action_controller.perform_caching = true
I googled around some and found this thread
On Sat, Apr 18, 2009 at 12:43 AM, Harold A. Giménez Ch.
harold.gime...@gmail.com wrote:
What DBMS are you using? The alternative is a materialized view.
postgres.
Name the fixtures.yml file after the actual target table, not the view.
I'll give that a shot. Thanks...
This didn't
Have a look at
http://github.com/aeden/rails_sql_views/tree/master
and my heavily hacked version
I looked at this. It didn't work in my setup.
http://github.com/mschuerig/rails_sql_views/tree/master
My version works with Rails 2.3.2, loads only the adapters that are
really needed,
The tests want to execute delete * from TABLENAME and this causes problems
when the table is actually a view.
Is there an easy way to deal with this issue?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby
on
If you have the need to do a lot of XML processing you are better off
staying away from rails completely. The State of SOAP on rails is a
mess to the point of being practically unusable. The XML and json
deserialization is like playing russian roulette with five bullets in
the chamber.
Try
Minus your mysterious 'change the xml' that worked for me.If you could
produce a more precise example (or at least elaborate on Doesn't
work (raises an exception, does nothing, has the wrong attributes,
something else...)
you might get a more helpful response.
Let's see.
u =
Is timezone a protected attribute (as in attr_protected or not on the
list given to attr_accessible) ?
No. It's changeable by the web GUI too. Also if that was the case
you'd expect the validation to throw up an error right?
Is the accessor function timezone= overwridden ? Does it work if
You probably want SOAP4R. See http://rubyforge.org/projects/soap4r/
and also my tutorial at
http://markthomas.org/2007/09/12/getting-started-with-soap4r
Thanks. I have written a stand alone ruby script that fetches the data
I want. The next step is to see if I can make it work in rails.
account_location plugin, then use account_domain and use it as a key in your
access management.
Different templates, same functionality: either switch the stylesheet (CSS)
or go un-DRY by using different view folders for each domain.
The account_location plugin talks about subdomains. Do
On Thu, Jul 3, 2008 at 6:24 PM, jacob v thomas [EMAIL PROTECTED] wrote:
hi all,
Here is the question, Is there a way to set multiple domain name for
accessing a single rails application,
Bump.
Is there a way to handle multiple domains including being able to use
different templates for
--
Building native extensions. This could take a while...
ERROR: Error installing ruby-pg:
ERROR: Failed to build gem native extension.
I had the same problem.
I have some additional questions.
Why is the official postgres gem for rails ruby-pr when it doesn't
work on windows at
49 matches
Mail list logo