I have the following files and would like to somehow package them together
in a gem however I'm unsure of what I need to create. An engine, a railtie,
or something completely different?
/lib/unit.rb
A unit class to handle a common requirement across my models
/app/concerns/unitify_concern.rb
> private
> def update_diameter_in_units
> write_attribute(:diameter, Unit.to_db(diameter_in_units))
> end
> end
On Thursday, November 1, 2012 3:48:55 PM UTC-4, Frank Mattia wrote:
> Thanks Scott,
>
> I'm closer but not quite there. I had originally tried virtual attribute
n you always reference f.text_field :DiameterStr.
>
> You could always play around with making the underlying attributes
> private, or at least a diameter= method which throws an exception... (Which
> slightly complicates DiameterStr=...)
>
> On Oct 29, 2012, at 5:57 PM, Frank Mattia
I have a requirement to store values in a database as unitless
decimals(12,9) which will be presumed to be metric values. For
display/editing purposes I need the user to be able to choose their input
method -- no mixing and matching on a form, just a simple
User#current_units call to determine
Matt Jones wrote in post #1080951:
> On Friday, 25 June 2010 01:12:47 UTC-4, frankj...@gmail.com wrote:
>> I have a ton of models that each have fairly complex state machines.
>>
>> My state_machine blocks however are very large and clutter up my
>> model.rb files...
>>
>> What I want to do is extr
Marnen Laibow-Koser wrote:
> frankjmat...@gmail.com wrote:
>> On Jun 25, 9:58�am, Marnen Laibow-Koser wrote:
>>> > I have a ton of models that each have fairly complex state machines.
>>>
>>>
>>>
>>>
>>> > What I want to do is extract out all of the state machine code to
>>> > another file that I
6 matches
Mail list logo