[Rails] Re: STI type value mapping

2015-11-06 Thread byrnejb
I had previously found this method referred to in an older API document but it was marked as being deprecated/removed in later version of Rails. Does this still work and if so is it going to be removed or replaced with something else? # File activerecord/lib/active_record/inheritance.rb, li

[Rails] STI type value mapping

2015-11-06 Thread byrnejb
I have never used STI with AR but I am now considering it. My question has to do with the Base.inheritance_column. According to the api docs: Active Record allows inheritance by storing the name of the class in a > column that by default is named “type” (can be changed by overwriting > Base.i

[Rails] Re: action-mailer 4.2 question regarding custom templates

2015-10-26 Thread byrnejb
The behaviour of the do-end block with respect to the render method and the template_path/template_name keys in the method argument list is by design. These two keys are intentionally discarded by the render method. However, it there also appears to be a problem when passing the template_path/

[Rails] action-mailer 4.2 question regarding custom templates

2015-10-22 Thread byrnejb
this_template_name ) mail( :to => recipients, :from => fm_address, :subject => subject, ) \ do |format| format.text do render( this_template ) end end But this causes this error: Missing t

[Rails] Rails-4.2.1 WebRick SSLEnable

2015-09-21 Thread byrnejb
in /usr/lib64/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/commands/server.rb at line 124 we see: url = "#{options[:SSLEnable] ? 'https' : 'http'}://#{options[:Host]}:#{options[:Port]}" My question is: How does one pass the option key :SSLEnable to webrick using* $ rails server* in develop

[Rails] ActiveRecord/Supporty-4.1, undefined method `assertions'

2014-07-29 Thread byrnejb
. I am trialing the project witjh AR-4.1 and I am getting this error when I try to run my cucumber features: undefined method `assertions' for # (NoMethodError) /home/byrnejb/Projects/Software/theHeart/code/hll_th_cadex_xfer/libexec/bundler/ruby/2.1.0/gems/rspec-expectations-3.0.

[Rails] Where did create_record method go in Rails-4.1

2014-07-25 Thread byrnejb
I have an audit plugin that chains to create_record (in 4.0 - formerly it chained to create) in ActiveRecord::Base. Where did create_record go to or get renamed to in 4.1? I cannot find an API reference to it after 4.0.2. -- You received this message because you are subscribed to the Google G

[Rails] Railties-4.0.1 - what happened to rake tmp:clear

2013-11-20 Thread byrnejb
MRI-2.0.0p247 Railties-4.0.1 We have a standalone Rails-3.2.15 based application that we are upgrading to 4.0.1. It uses only the following components of Rails-4.0.1: * actionmailer (4.0.1) * actionpack (4.0.1) * activemodel (4.0.1) * activerecord (4.0.1) * activesupport (4.0.1) * a

[Rails] Save method behaviour changed?

2013-03-05 Thread byrnejb
I have this code in a working RoR-3.1 app: # save # # Override AR save method to catch DBMS specific errors # such as uniqueness constraint violations def save super rescue ActiveRecord::StatementInvalid => this_exception errors.add( currency_code, hll_ar_exception( this_ex

Re: [Rails] Proper use of the where method om ActiveRecord.

2012-11-13 Thread byrnejb
On Tuesday, November 13, 2012 4:16:17 PM UTC-5, Colin Law wrote: > By using :is_billed => false you are telling rails that you want the > value to be whatever rails uses as the logical value false (which > appears to be "f"). By specifying yourself that the contents of the > column must be t

Re: [Rails] Proper use of the where method om ActiveRecord.

2012-11-13 Thread byrnejb
On Tuesday, November 13, 2012 3:45:30 PM UTC-5, Colin Law wrote: > Look in log/development.log to see what the difference is in the > queries (which should be logged there). Then it will probably make > sense. > This is the difference: (0.2ms) SELECT COUNT(*) FROM "tests" WHERE (is_bil

[Rails] Proper use of the where method om ActiveRecord.

2012-11-13 Thread byrnejb
I am trying to determine what is going on with the following code: In AR def self.all_billables where( :is_billed => false ) end returns 2 records. def self.all_billables where( "is_billed" => false ) end also returns 2 records. In sqlite3 sqlite> select * from tests where ( "is_billed"

[Rails] Updating objects in arrays

2012-11-12 Thread byrnejb
Perhaps this is a Rails issue. However, I need to first determine whether I simply am missing something about updating members of an array. I have an array of 10 ActiveRecord objects. I wish to iterate over the array and update an attribute. When I do this the underlying table row changes bu

[Rails] Rails 3.1 and SQLite3

2012-02-27 Thread byrnejb
I am getting this message when running my tests against RoR-3.1 .rvm/gems/ruby-1.8.7-p352/gems/activerecord-3.1.1/lib/active_record/ connection_adapters/abstract/connection_specification.rb:71:in `establish_connection': Please install the sqlite3 adapter: `gem install activerecord-sqlite3-adapter`

[Rails] Problem with rake db:test prepare in RoR-3.1.1 and PostgreSQl-9.1?

2012-02-24 Thread byrnejb
CentOS-5.7 ruby-1.8.7-p352 [ x86_64 ] Rails-3.1.1 When I do this: $ rake db:test:prepare Using AdapterExtensions Then I see this: psql:/.../db/development_structure.sql:22: ERROR: must be owner of extension plpgsql The offending line is 22 COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural

[Rails] passenger 3.0.11 socket error

2012-01-09 Thread byrnejb
I have posted this question to the Phusion list but have had no answer. Our Redmine application was recently moved to a CentOS-6.2_i86_64 server with SELinux set to Permissive.. Initially it started up and ran without error. This morning we are getting this: ---> Internal Server Error The ser

[Rails] Re: Rails and MySQL woes

2011-12-09 Thread byrnejb
Re: MicroSoft Windows, Ruby, and Ruby on Rails (RoR) I formerly did a lot of offline development in Rails on a Windows XPpro system. I started out using pre-packaged native MS-Win binaries but eventually ran into a situation where the available Windows package simply did not work following a Micr

[Rails] Rails-3.1.1 Deprecation warnings:

2011-11-07 Thread byrnejb
When I run cucumber I now see these messages: DEPRECATION WARNING: ref is deprecated and will be removed from Rails 3.2. (called from require at /home/byrnejb/.rvm/gems/ruby-1.8.7- p352@global/gems/bundler-1.0.21/lib/bundler/runtime.rb:68) DEPRECATION WARNING: new is deprecated and will be

[Rails] Re: Problem with Rails3.1.1 in mass_assignment_authorizer

2011-11-07 Thread byrnejb
I found my problem is a library I wrote to turn off mass assignment . In it I am calling this: # override AR method def mass_assignment_authorizer if accessible == :all self.class.protected_attributes else super + ( accessible || [] ) end end Mass_assignment_authori

[Rails] Problem with Rails3.1.1 in mass_assignment_authorizer

2011-11-07 Thread byrnejb
By accident I had Rails-3.1.1 installed by bundler. However, when I discovered this mishap during my feature run I encountered this error in many places: wrong number of arguments (1 for 0) (ArgumentError) /home/byrnejb/.rvm/gems/ruby-1.8.7-p352/gems/activemodel-3.1.1/ lib/active_model

[Rails] Re: Do you agree that as some point, every (big enough) Rails app sould not rely only on ActiveRecord?

2011-02-24 Thread byrnejb
On Feb 24, 5:09 am, Michel Pigassou wrote: > It's not that I don't agree, I just don't have an opinion on this matter and > asking for thoughts :) > Why Rails with a SQL db would not be enough to *always* scale an app? The quotation does not claim that. What it says is that the ActiveRecord OR

[Rails] Re: How do you turn off notices using PostgreSQL 9?

2010-11-17 Thread byrnejb
On Nov 17, 2:28 am, Phoenix Rising wrote: > > > One last thing: how the hell do you correctly pronounce PostgreSQL? > "Post-gray-sequel", "Post-gress", or something else?  Additionally, > what's the community's opinion in general on performance for PGSQL 9 > vs. MySQL 5.1? No holy wars here, ple

[Rails] Need help with ActiveWarehouse-ETL-0.9.1 PG connection problem

2010-04-07 Thread byrnejb
I am trying to load conversion data into a postgresql database using activewarehouse-etl. I can create a flat file output from the conversion data without problem. However, when I try to load into the table using the information contained in config/database.yml I see this error: /usr/lib64/ruby/

[Rails] not null error from PG on build_other call

2010-03-18 Thread byrnejb
I have this code in a stand alone script that uses nokogiri with activerecord to parse an xml file and initialise a database. begin this_client = correspondent_f.build_client rescue => e puts("Rescued error in build.") puts(e.backtrace) puts(" ") p

[Rails] Mass update of associated models

2010-03-12 Thread byrnejb
I am importing historical client data from a CODASYL DBMS into PostgreSQL via an xml document. I am at the point where I am implementing the actual inserts/updates using ActiveRecord. In the new system a Client belongs to a Correspondent. In previous cases I have had to deal with only one model

[Rails] You are being redirected

2010-02-19 Thread byrnejb
I have done something to my application controller so that instead of the redirected page itself am now seeing this as a response: You are being http://www.example.com/ welcome">redirected. I do not know why this is happening or what I did to trigger this behaviour. The API does not give me an

[Rails] Re: attr_accessible question

2010-01-29 Thread byrnejb
On Jan 28, 6:28 pm, Marnen Laibow-Koser wrote: > > > is there some simple way to later add :d > > Model.attr_accessible :d > > > or remove :c? > > I'm not sure. > So is attr_accessible is a one-way trip? Is is the case that once an attribute is added to the attr_accessible collection then ther

[Rails] attr_accessible question

2010-01-28 Thread byrnejb
Can one vary which attributes are available for mass assignment ? In other words, if I had this statement in a model attr_accessible :a, :b:, :c is there some simple way to later add :d or remove :c? -- You received this message because you are subscribed to the Google Groups "Ruby on Rails:

[Rails] Re: fields_for object methods - no you see them, now you don't

2010-01-28 Thread byrnejb
On Jan 28, 12:53 pm, Colin Law wrote: > On 28 January 2010 17:51, byrnejb wrote: > > > > > On Jan 28, 12:47 pm, byrnejb wrote: > > >>     And we follow the new user roles > >> link                                   # features/app/models/ > >> c

[Rails] Re: fields_for object methods - no you see them, now you don't

2010-01-28 Thread byrnejb
On Jan 28, 12:47 pm, byrnejb wrote: >     And we follow the new user roles > link                                   # features/app/models/ > clearances/step_definitions/clearance_steps.rb:14 >       undefined method `newrecord?' for # > (ActionView::TemplateError) &g

[Rails] fields_for object methods - no you see them, now you don't

2010-01-28 Thread byrnejb
I have this: <%-f.fields_for(:clearances, :index => []) do |ff| puts ff.object.methods.sort if ff.object.newrecord? ff_id = "new_" else ff_id = "show_" end -%> Which gives me

[Rails] Re: Regarding form_for and fields-for content variable

2010-01-26 Thread byrnejb
On Jan 26, 9:20 am, byrnejb wrote: > > Now, while I know that ff != dependency This should be association rather than dependency. What I am asking is why, when ff acts in the place of a specific model.association, I cannot reach model.association.dependency.attribute. The problem

[Rails] Regarding form_for and fields-for content variable

2010-01-26 Thread byrnejb
I am trying to understand what I am working with when I deal with Rails forms_for and fields_for constructors. Given model has_many associations belongs_to dependency and dependency has_many associations belongs_to model > @model = Model.find(:id) and > forms_for @model do |f| w

[Rails] Re: nested forms and attr_accessable

2010-01-22 Thread byrnejb
I have some further trace information regarding this situation. I am really at a bit of a loss here on how to proceed. I cannot find any evidence that the update user attributes is working. This is in my User model: has_many:roles, :through => :clearances has_many

[Rails] nested forms and attr_accessable

2010-01-21 Thread byrnejb
Rails 2.3.5 I am working on a nested form that assigns roles to users through a table called clearances. I have attr_acessable turned off globally in an initializer: ActiveRecord::Base.send(:attr_accessible, nil) I have this set in clearance.rb attr_accessible(:description, :effective_fr

[Rails] Re: ror developers

2010-01-21 Thread byrnejb
Sns Sem wrote: > what are the primary requirements for ror developers? > > asker: http://www.rordevelopers.com > -- > Posted via http://www.ruby-forum.com/. 1. host 2. ruby 3. rails 4. editor (textmate, vim, etc.) Some people prefer IDE's instead. 5. development and testing tools (cucumber / rsp

Re: [Rails] Re: scope problem in controller

2010-01-21 Thread byrnejb
Jeffrey L. Taylor wrote: > > end > > Do you mean 'return result' here? > > Jeffrey Thank you for pointing out the error with the return. I fixed that and and then finally realised that I was not assigning my return value when calling the method recursively. This was why the result was di

[Rails] Re: scope problem in controller

2010-01-20 Thread byrnejb
I am clearly misunderstanding something fundamental about ruby methods and the return statement. I have finally gone for the blunt force solution so that I can follow along with what is happening. def keywalk(tcoll,tkey,result=nil) if result puts("result returned = #{result}")

[Rails] :id vs. a_id:

2010-01-20 Thread byrnejb
I have a controller a_bs_controller that usually has to find A by a_id:. So, among others, it has these methods: def update this_a . . . end . . . def this_a @a = A.find(params[:a_id]) end My difficulty arises in that sometimes this controller is passed :a_id in a nested hash as [:a]

[Rails] Re: scope problem in controller

2010-01-19 Thread byrnejb
On Jan 19, 7:17 pm, Frederick Cheung wrote: > > blocks can see variables created outside them (but local variables > created inside the block do not persist outside it) > Your keywalk function will however almost always return nil - when you > recurse and call keywalk a second time you are igno

[Rails] scope problem in controller

2010-01-19 Thread byrnejb
I am writing a small helper to walk a hash or an array of arrays to find a nested key. (by the way, if there is an existing function for this in Ruby I will willingly take it instead). The call is this keywalk(collection, key) the def is this def keywalk(collection,key) key = key.to_s coll

[Rails] Re: AR - find all records not already associated

2010-01-18 Thread byrnejb
On Jan 18, 1:42 pm, Marnen Laibow-Koser wrote: > > Here's sample SQL -- you can work out the find! > Thanks. I will have a go at it. -- 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..

[Rails] Re: AR - find all records not already associated

2010-01-18 Thread byrnejb
Let me rephrase the question. How would one construct an AR find so as to return the desired subset of B records in a single SQL query? -- 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...@

[Rails] AR - find all records not already associated

2010-01-18 Thread byrnejb
Given A has_many :B :through => :C A has_many :C B has_many :A :through => :C B has_many :C C belongs_to :A C belongs_to :B What is the idiomatic way to find all B that are not associated with a given value for A? This will work but is there a simpler way? this_a = A.find_by_attribute('value')

[Rails] Re: - Help with Regular Expressions on PHP.

2010-01-15 Thread byrnejb
On Jan 14, 2:30 pm, Edson Lopes wrote: > Hello, im having a trouble on Regular Expressions (on PHP) ,,, > > Can some one help me with this RE on PHP? Regexp are regexp. It really should not matter how or from what language they are called, unless the implementation varies. If you are having p

[Rails] Re: Help me to Install Ruby on Rail & Cucumber

2010-01-15 Thread byrnejb
On Jan 14, 2:25 am, Anand Somani wrote: > Hello, > > I went to Install Cucumber on my system. Can you please guide me which > version of ruby on rail will support Cucumber v2.3.5? > Cucumber is not dependent on Rails. Cucumber-Rails will work with any version of Rails but its generators probab

[Rails] Re: ActionBuilding a new association in a form

2009-12-21 Thread byrnejb
On Dec 18, 9:50 pm, Manuca wrote: > > What I found in those tutorials about complex forms is that they > create relations on the fly to new objects (also created in the same > process) and this case is slightly different you need to establish a > relation between the object you are instantiating

[Rails] ActionBuilding a new association in a form

2009-12-18 Thread byrnejb
I would like to use a single form to display multiple existing associations and to permit additions to those that already exist. In its simplest form a row in U has an association to a row R through a row in C. Now, in my case both R and U must exist before they may be associated and neither may

[Rails] Re: Why do so many Ruby/Rails developers use Macs?

2009-12-14 Thread byrnejb
On Dec 4, 1:33 pm, Jim Knowlton wrote: > I am a QA engineer who works in Ruby quite a bit, and I've never been > able to figure out...why is there a disproportionately large > contingent of Mac users among Ruby developers?  Macs are probably 10 > percent of the computer market, but every time I

[Rails] Re: which is the most popular Ruby on Rails AUTHORIZATION gem/plugin at the moment???

2009-12-14 Thread byrnejb
On Dec 12, 10:01 pm, greghauptmann wrote: > Hi, > which is the most popular Ruby on Rails AUTHORIZATION gem/plugin at > the moment??? I have not a clue as to what is the most popular, whatever that means. But, you might take a look at Declarative Authorization. -- You received this message b

[Rails] Re: stupid question about BDD

2009-12-03 Thread byrnejb
On Dec 2, 12:52 pm, Christoph Jasinski wrote: > Hi, > > I'm divin' into BDD with RSpec, Cucumber & Friends and wanted to know > whether I got it right. When I go for BDD I skip unit tests? Is that right > or am I wrong? Neither. It depends on your workflow, the resources that you have and resu

[Rails] Input text value retrieve id value

2009-11-30 Thread byrnejb
In the view, when add a new row to a join table (A has_many :bs :through :zs). if one wishes to display and require the name value instead of the id value in the form partial, what is the correct procedure to follow? The examples that I see usually provide a drop down selector that is pre-populat

[Rails] Re: Nested routes and a missing method

2009-11-12 Thread byrnejb
On Nov 12, 2:22 pm, byrnejb wrote: > > However, when I try using "link_to to user_roles" I get this method > missing error.  What am I doing wrong? > >  NameError in Users#show > > Showing app/views/users/show.html.erb where line #59 raised: > > undefined

[Rails] Nested routes and a missing method

2009-11-12 Thread byrnejb
I have this nested route: map.resource :users do |user| user.resources :roles end Which, among others, gives me this named routing, user_roles: user_roles GET/users/:user_id/roles (.:format) {:controller=>"roles", :action=>"index"} However, when I try us

[Rails] Re: Keeping track of model changes with Paper Trail

2009-09-18 Thread byrnejb
On Sep 17, 6:08 pm, Martin Streicher wrote: > Archive all versions of your model. > > http://www.linux-mag.com/id/7528 > > Thanks for reading. > Martin Would it not be more valuable to have the most recent (current) view of the model archived? In that case one may readily detect if any untrac

[Rails] Re: noob simple question create custom options_for_select

2009-09-18 Thread byrnejb
On Sep 17, 9:04 am, Marcos Müller wrote: > Hello everyone, > > I'm starting learning ruby on rails and i have a question that maybe is more > about ruby but anyway. > > I have a table with 2 columns type and value and i would like to create a > select that had like options all the values but fo

[Rails] Re: Best Practices Question

2009-08-10 Thread byrnejb
On Aug 6, 10:43 am, TomRossi7 wrote: > Should models call action mailers, or should those calls always > originate from controllers?  For example, should user.forgot_password > send the email, or should the user_controller.forgot_password? > > Just looking for some opinions... Consider the que

[Rails] Re: Best book to learn RoR??

2009-08-05 Thread byrnejb
On Aug 5, 9:26 am, byrnejb wrote: > My votes would have to be for both of David Black's efforts,  "Ruby > for Rails" and "The Well Groomed Rubist".   Ohhh jeeez, did I write that? It is the "Well Grounded Rubist." everyone knows

[Rails] Re: Best book to learn RoR??

2009-08-05 Thread byrnejb
On Aug 5, 6:37 am, Eddy Josafat wrote: > Agile Web Development with Rails 3rd edition is the best choice, also > The Rails Way give you some deep insight. > > Programming Ruby and Ruby Cookbook are good choices to learn Ruby > > On Aug 4, 5:43 pm, Sood wrote: > > > I am a PHP developer and I a

[Rails] Re: Rails date conversion

2009-07-29 Thread byrnejb
On Jul 28, 1:28 pm, Daniel Waite wrote: > I ask these questions because I have a scenario whereby an AR-backed > object, when issued the "published_at" method yields a date like "Tue > Jul 28 17:04:58 UTC 2009". However, when *finding* the object, e.g. > Object.first, I get what looks like a U

[Rails] Re: Auth / Search / Paging

2009-07-23 Thread byrnejb
On Jul 22, 6:14 am, Sergio Angeletti - Gmail wrote: > > now can you suggest me a solution for add an siple search on the > scalfolds and a paging? > Have you looked at searchlogic, by the author of authlogic? --~--~-~--~~~---~--~~ You received this message beca

[Rails] Re: Help For Testing ruby on rails?

2009-07-22 Thread byrnejb
On Jul 22, 12:54 am, Karthik Kantharaj wrote: > Hi guys > > I am using Aptana IDE > > How to do unit testing is there any sample explaining this > > I got some tutorial but that is not complete as i am a beginner > I just went through this experience myself and I will tell you that there are m

[Rails] Re: Empty string and nil values help needed

2009-07-21 Thread byrnejb
On Jul 21, 11:42 am, Cs Webgrl wrote: > Tests run on this method work fine if I'm not passing in a nil value. > I'm not quite sure where else to look.  Any thoughts? > What does the application stack trace say? --~--~-~--~~~---~--~~ You received this message be

[Rails] Re: my first app with RoR problem.

2009-07-21 Thread byrnejb
On Jul 21, 7:07 am, Renz Mendoza wrote: > C:\Ruby>gem install sqlite3-ruby > Building native extensions.  This could take a while... > ERROR:  Error installing sqlite3-ruby: >         ERROR: Failed to build gem native extension. > > C:/Ruby/bin/ruby.exe extconf.rb > checking for fdatasync() in

[Rails] Re: Execute Ruby Script

2009-07-15 Thread byrnejb
On Jul 14, 7:31 am, Hans Hartmann wrote: > I try and try... > but I can't make the script be executed (nor an other Programm) > Can someone give me an example to execute external files with rails? So > I can get an idea of the path-description. > > Thx a lot > -- > Posted viahttp://www.ruby-for

[Rails] Re: Puts just work on Controllers

2009-07-10 Thread byrnejb
On Jul 10, 5:33 am, Damaris Fuentes wrote: > Ok, I will take a look to these ways for debug. > However, I still don't understand why my "puts" don't work. > My non-Active record models are not in the app/model directory, but in > an app/engine directory (is someone else work), can be this the p

[Rails] Re: Shared Model Methods

2009-07-02 Thread byrnejb
On Jul 1, 6:05 pm, Ar Chron wrote: > > class GenericModel < ActiveRecord::Base >   self.abstract_class = true >   # generic implementations shared by all models >   # my app has some 30 'generic' model methods, relationship >   # management, cache management, pdf generation, etc > end > > clas

[Rails] custom finder in associated model.

2009-06-29 Thread byrnejb
I have a model for which I have provided a customer finder method, 'find_one_by_date(params)', where params is a hash. This method always returns one or no record from the DB. I would like to define an association, has_one, from another model to this one, passing the params hash and using the cu

[Rails] Select for boolean attribute

2009-06-25 Thread byrnejb
I would like to use a select box to display and edit a boolean model attribute. I realize that perhaps checkboxes or radio buttons are a more idomatic way to do this in html but I would like to use a select box. What I want to do is to map the selected value in the box to the existing value of t