[Rails] Re: Alternatives to 'SET' data type

2011-10-21 Thread Owain
> > There are plugins that will do all of this for you... search for something > like "rails bit field plugin" I use has bit field which is here: https://github.com/pjb3/has-bit-field -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To

[Rails] Re: Counter gem out there?

2011-08-10 Thread Owain
On Aug 10, 5:09 pm, Colin Law wrote: > On 10 August 2011 13:49, Robert Walker wrote: > > > Owain wrote in post #1015933: > >> My application is gradually being refined and it is becoming necessary > >> to provide some statistics.  I don't really want to

[Rails] Re: Counter gem out there?

2011-08-10 Thread Owain
> Consider the example you mentioned; It seems likely that users would be > interested in "August 2011 Orders" sometime in September, or later. It > would also be likely that they would want to compare August with the > results from August of the prior year. > > Using data mining techniques these

[Rails] Counter gem out there?

2011-08-10 Thread Owain
Hi, My application is gradually being refined and it is becoming necessary to provide some statistics. I don't really want to add all of these into the main application logic since it is not critical. I would like to "observe" a bunch of models and classes and increment and decrement counters.

[Rails] Re: Active Record track changes with update_attributes

2011-07-28 Thread Owain
> You could do order.attributes = params[:order], inspect the changes > and then save the object. > > Fred @fred that worked perfectly. -- 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-tal

[Rails] Active Record track changes with update_attributes

2011-07-05 Thread Owain
I am not sure I am thinking about this the correct way. I have a admin/maintenance scaffold to amend live data and I need to track the changes to data related to an order. e.g. change of address. I have a order_transaction model which I would like to record all of the data changes through the ad

[Rails] Rails 2.3.10 reporting gem recommendation?

2011-06-20 Thread Owain
Does anyone have any suggestions/recommendations of a reporting gem/ plugin/tool framework. I would like to produce some canned reports from some ActiveRecord data. e.g. orders by week. Generate a report or a chart and possible be able to download the raw CSV data for the Excel mungers. Obviousl

[Rails] Re: Mysql dapter reporting Duplicate Entry mystery

2011-04-28 Thread Owain
On Apr 28, 1:18 pm, Frederick Cheung wrote: > On 28 Apr 2011, at 13:13, Owain wrote: > > > > > > > On Apr 28, 12:57 pm, Frederick Cheung > > wrote: > > >>> mysql> insert into confirmations (quote_id) values(188); > >>> Quer

[Rails] Re: Mysql dapter reporting Duplicate Entry mystery

2011-04-28 Thread Owain
On Apr 28, 12:57 pm, Frederick Cheung wrote: > > mysql> insert into confirmations (quote_id) values(188); > > Query OK, 1 row affected (0.01 sec) > > > mysql> select * from confirmations where quote_id = 188; > > Why are you filtering by quote_id here? > Fred, Just to show that the mysql CLI cl

[Rails] Mysql dapter reporting Duplicate Entry mystery

2011-04-28 Thread Owain
I have an application (Rails 2.3.10) that is bombing out with the following message: A ActiveRecord::StatementInvalid occurred in confirmation#create: Mysql::Error: Duplicate entry '185' for key 1: INSERT INTO `confirmations` (`flags`, `quote_id`, `created_at`, `updated_at`, `id`, `serialnum`) V

[Rails] SSL Requirement double POST from IE on expired certificate

2011-03-28 Thread Owain
This is really weird. User testing in my staging environment where the SSL certificate for the secure domain has expired. Here is the scenario: User fills in a form containing a serial number which has to be unique. which I use validate_uniqueness and a unique index on the mysql db (belt and brac

[Rails] Sharing session data between domains

2011-03-22 Thread Owain
Hi, Has anyone come up with a clean(ish) way of sending data from a session in one domain to another session in another (SSL) domain. Both domains are on the same application. Scenario is: - collect data during the shopping process to create an "order". The critical order data can be stored in

[Rails] Re: self.prepend_view_path - am I missing something

2011-02-22 Thread Owain
> >   def set_view_paths > >     self.prepend_view_path "app/views/#{controller_name}/ > > #...@domain.policy.policy_type}" > >   end > Above worked in development but not in testing unless you provide an absolute path for integration testing. def set_view_paths self.prepend_view_path ["#{

[Rails] Re: self.prepend_view_path - am I missing something

2011-02-22 Thread Owain
On Feb 21, 6:58 pm, Owain wrote: > I have an app that varies its content based upon the domain from which > it is being accessed.  Some of the domain characteristics are > supported in the model but it is easier varying static text in the > views and then sharing the form templates

[Rails] self.prepend_view_path - am I missing something

2011-02-21 Thread Owain
I have an app that varies its content based upon the domain from which it is being accessed. Some of the domain characteristics are supported in the model but it is easier varying static text in the views and then sharing the form templates via partials etc. Rails 2.3.10 and looking at the docume

[Rails] Webbots and Rails Technique

2011-01-28 Thread Owain
My application (2.3.8) has been live for some time now and I have been getting it indexed by Google and some other bots. These bots are throwing exceptions in the application when they perform a GET request on some of my controllers with no params, particularly with Ajax requests and Auto_complete.

[Rails] Re: Scheduled tasks on rails

2011-01-13 Thread Owain
> Whatever.  Then the question is one for the Apache forums, not Rails. > Indeed. However, it is of interest to solicit views as to how other people approach this problem. Cron with Curl looks a simple and sensible way of automation. What's Donz's approach? O. -- You received this message b

[Rails] Re: Scheduled tasks on rails

2011-01-12 Thread Owain
> > Look at local_request? method in ActionController. > Jeffrey, Certainly another option but I would prefer not to have "network config" logic in my application if I can help it. If you want to manage all of the housekeeping jobs from a remote curl or put in load balancers you would need to ch

[Rails] Re: Scheduled tasks on rails

2011-01-12 Thread Owain
On Jan 12, 2:54 pm, "Donald R. Ziesig" wrote: >   Douglas, > > I have been using cron tasks that invoke curl that invokes the routes > that perform the periodic tasks for several years. Do you wrap some security on those routes at the web-server level or in the application? If you secure at the

[Rails] News: Heroku bought: Salesforce wants some Ruby love: $212m goes a long way

2010-12-10 Thread Owain
News to me. Probably worth considering when choosing your deployment options. http://www.theregister.co.uk/2010/12/09/salesforce_why_buy_heroku/print.html Dreamforce 2010 Why would a company that spent 10 years delivering CRM as a service drop $212m in cash and $27m in stock on a 30-person start

[Rails] Re: Better approach to set global values?

2010-11-24 Thread Owain
> However isn't there a better way to do this? Initially I thought I could > do something more elegant like this: How about moving the config out of the code by using the plugin. https://github.com/cjbottaro/app_config You can put your defaults in a file default.yml and then "over-ride" with the

[Rails] Re: Best way to test web services and XMLHttpRequest

2010-11-17 Thread Owain
I have been using the ruby rest-client to test the webservice integration: see https://github.com/archiloque/rest-client in conjunction with cucumber and rspec. Admittedly in a Sinatra environment but it will work with Rails too. That and Xpath http://ruby-doc.org/stdlib/libdoc/rexml/rdoc/classe

[Rails] Re: multiple domain names mapping to different rails app URLs

2010-10-26 Thread Owain
A quick look and the following points: - you are not scoping your property_id to the domain. If you go to http://chaletcordee.co.uk/properties/1 you can change to properties 2 in the domain controller and you pick up the other property. Your application controller should set an instance variable

[Rails] Re: multiple domain names mapping to different rails app URLs

2010-10-25 Thread Owain
I have built something along these lines and here is how it might work for you. Have a domain model that maps a domain name to a property_id(decide whether you are going to use www or no-www (http://no-www.org/) or both if you want but it it is better to choose one or the other for SEO and analyti

[Rails] Re: Implementation of Sets in AR

2010-08-25 Thread Owain
On Aug 25, 6:16 pm, Marnen Laibow-Koser wrote: > Owain wrote: > > Marnen > > > Thank you for taking the trouble to reply. > > > On Aug 25, 5:40 pm, Marnen Laibow-Koser wrote: > >> Owain wrote: > > >> No, I think it does. You *want* each resource

[Rails] Re: Implementation of Sets in AR

2010-08-25 Thread Owain
Marnen Thank you for taking the trouble to reply. On Aug 25, 5:40 pm, Marnen Laibow-Koser wrote: > Owain wrote: > > That could > > be done by serializing the Set object but then I lose the ability of > > database queries (in particular indexing performance gains) to do >

[Rails] Implementation of Sets in AR

2010-08-25 Thread Owain
I am at the very early design stages of a web service to implement a "booking engine". I want it to be a generic in so far as the resource being booked could be anything, a tennis court, hotel room, ski chalet or airline seat. It's up to the client (RoR) application calling the webservice to dete

[Rails] Re: Deployment: adding git tag as HTML meta tag

2010-08-10 Thread Owain
/rubyonrails-talk/browse_thread/thread/53be9640c1a16faa/aa0c607502b3a059?hl=en&lnk=gst&q=owain#aa0c607502b3a059 but in summary: /app/config/initializers/revision.rb filename = File.expand_path('REVISION', RAILS_ROOT) REVISION = File.exist?(filename) ? File.read(filename) : `cd #{

[Rails] Re: rails 2.3.8 and html_safe

2010-08-03 Thread Owain
I just hit a similar problem where I was concatenating strings with escapable characters within a formbuilder. I googled about and there seems to be a some logic being discussed that anything that is "magic security" is going to be a nightmare. My problems were quite isolated (the great thing abo

[Rails] Re: An active list, but not very useful

2010-07-28 Thread Owain
Guys, A very interesting post since I was thinking along exactly the same lines. It is apparent that there is now a very different type of poster within even the last three months who often have some very basic questions, most of which are answered when you RTFB. I notice posts are increasingly:

[Rails] Re: FTP: which FTP is best for Ubuntu to upload rails project

2010-06-30 Thread Owain
On Jun 29, 5:23 pm, Ali Imran wrote: > I am trying to upload the constants to my shared server but built in > FTP in Ubuntu is not working Ali Investigate whether you can ssh up to your shared server. If you can then I suggest you invest a little bit of time to set up capistrano deployment vi

[Rails] Re: ActionView::Base - can it dynamically select views?

2010-06-12 Thread Owain
f not fall back to the default set. Further thinking in the OP below. Any ideas gratefully received. O. On Jun 10, 9:10 am, Owain wrote: > There are some similar discussions about but none seem to have a > definitive answer of this one. > > I have an application which supports mul

[Rails] ActionView::Base - can it dynamically select views?

2010-06-10 Thread Owain
There are some similar discussions about but none seem to have a definitive answer of this one. I have an application which supports multiple domains. In the application controller I look up the domain being requested and pull some attributes from a Domain model which determines thing such as con

[Rails] Rails 3 Migration Guide Anywhere?

2010-06-10 Thread Owain
Has anyone developed or come across on how to migrate to Rails 3 from prior releases. I would like an idea of how much work it would be. O. -- 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

[Rails] Re: de-crypting Ruby password with php.

2010-05-10 Thread Owain
In case you do not have a working Ruby app with a console available the answer is: "--1234--5678--" The document on the digest is avaialble here: http://ruby-doc.org/stdlib/libdoc/digest/rdoc/index.html -- You received this message because you are subscribed to the Google Groups "Ruby on Rails

[Rails] Re: NULL value in CSV fixture, howto?

2010-05-07 Thread Owain
Looks like the answer lies in CSV's method each_with_index lib/active_record/fixtures.rb, line 720 def read_csv_fixture_files reader = CSV.parse(erb_render(IO.read(csv_file_path))) header = reader.shift i = 0 reader.each do |row| data = {} row.each_with

[Rails] Re: NULL value in CSV fixture, howto?

2010-05-07 Thread Owain
create_table "domains", :force => true do |t| t.string "column1" t.integer "child_id" t.string "column2" t.datetime "created_at" t.datetime "updated_at" end so there is nothing in there but a good suggestion to check first. Looks like 0 is the default value for integer

[Rails] NULL value in CSV fixture, howto?

2010-05-06 Thread Owain
I am preparing some seed data for a deployment from generated a CSV file. However, one of the model's columns ( child_id) needs to have a null value in on a few of the rows where there is no Child instance. Whatever I have put in there, it seems to just come in as a zero. I have tried several com

[Rails] Re: App to Pick up application release from Git/Capistrano?

2010-04-26 Thread Owain
so here it is my solution; /app/config/initializers/revision.rb filename = File.expand_path('REVISION', RAILS_ROOT) REVISION = File.exist?(filename) ? File.read(filename) : `cd #{RAILS_ROOT} && git rev-parse HEAD`.strip /app/views/layout/application.html.erb <%- unless production? %> <%= "#{RE

[Rails] Re: App to Pick up application release from Git/Capistrano?

2010-04-23 Thread Owain
Thanks Peter and Rob. I think it would still make sense to do this during initialization rather than at the application controller since it is during initialization is then it will change. I will also add some logic to the view just to check REVISION is there, perhaps in future the app might not

[Rails] App to Pick up application release from Git/Capistrano?

2010-04-22 Thread Owain
My application is going into user testing and I would like to see which "release" the user has been testing against by the release appearing somewhere on the view. I can then check it on screen prints etc. I am using Git and Capistrano in a multi-stage environment. I expect I could access the ca

[Rails] Simple application monitoring

2010-03-25 Thread Owain
I have just had a server halt itself and it took me some time to notice. I am planning on implementing some application monitoring using an external service that polls the website from outside. If it can't reach it then it will SMS me or something. (I would like Prowl on my iPhone and Mac at the

[Rails] Re: Sometimes losing decimal scale on mysql - ok on sqlite

2010-03-17 Thread Owain
Here are two links that explain that you need to be careful on decimal columns when using mysql on the target platform. sqlite3 is a little more forgiving. http://scottmotte.com/archives/86.html http://blog.coryfoy.com/2008/06/problems-in-rails-between-development-and-test-databases/ I sorted my

[Rails] Sometimes losing decimal scale on mysql - ok on sqlite

2010-03-17 Thread Owain
I posted this yesterday but it was a bit long-winded: http://groups.google.com/group/rubyonrails-talk/browse_thread/thread/9a6db7467a16911e Here is a more succinct version. Migration generates decimal(8,2) column type ok on sqlite but decimal(10,0) on mysql. So I lose pence and cents on mysql!

[Rails] Losing Decimal scale from sqlite3 to mysql going from development to staging.

2010-03-16 Thread Owain
I have been performing some testing between my development and staging environments. I had noticed that the order.amount has been truncated. All works fine in sqlite3 in development. Here is the output: Amount is meant to be decimal (8,2) to support pounds and pence (or dollars and cents). cla