>
> 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
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
> 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
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.
> 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
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
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
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
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
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
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
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
> > 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 ["#{
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
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
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.
> 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
>
> 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
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
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
> 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
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
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
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
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
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
>
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
/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
#{
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
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:
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
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
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
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
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
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
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
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
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
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
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
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
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
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!
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
45 matches
Mail list logo