k has significance.
Allen Madsen
http://www.allenmadsen.com
On Tue, Dec 29, 2009 at 1:27 AM, Andrew White wrote:
> On 28 Dec 2009, at 18:04, Josh Susser wrote:
>
> > That's reasonably concise, but just keep in mind that all of this is
> > just to make Ruby act more like Perl w
I believe ruby uses it internally to track the objects. If you change or
remove the object_id, then nothing will be referencing that object and the
garbage collector will eat it up. All this is heresay though, until someone
confirms it.
Allen Madsen
http://www.allenmadsen.com
On Tue, Dec 29
Rodrigo,
You should be doing something like:
class NewString < String
def initialize(options={})
@options = options
end
def to_s
@options[:message]
end
end
That will give you the desired result.
Allen Madsen
http://www.allenmadsen.com
On Thu, Dec 31, 2009 at 4:11 PM, Rodr
You could have the gem install the thor task for you. That way you
only get the task if the gem is available.
Allen Madsen
http://www.allenmadsen.com
On Thu, Jan 28, 2010 at 9:36 AM, Kristian Mandrup wrote:
> Hi,
>
> I have been working a lot on getting a grasp of creatin
I agree with Trey. People learning Rails should be learning the
conventions, not the exceptions. As for the learning curve, I think it
is simple enough to generate a scaffold.
Allen Madsen
http://www.allenmadsen.com
On Mon, Feb 15, 2010 at 8:53 PM, Trey wrote:
> Hey Anthony,
>
&
The idea as it stands now is that the abstraction will happen at the
javascript layer. So there will be a common rails javascript library
that supports adapters to the other javascript libraries.
prototype_helper should go away completely and be replaced by a rails
common javascript helper.
Allen
It doesn't exist yet. Currently it's an idea for a RubySoC project
[1]. When I get time this week or next I'll be writing a proposal for
it.
[1] http://wiki.rubyonrails.org/rubysoc/2010/ideas#action_view
Allen Madsen
http://www.allenmadsen.com
On Mon, Apr 12, 2010 at 8:47 PM,
Kristian,
If I understand what you are trying to do, then its a little
backwards. You really shouldn't be generating view stuff in the
controller. Instead you can create a class variable like @logged_in
and then use that to selectively show certain components in the view.
Allen Madsen
+1
Allen Madsen
http://www.allenmadsen.com
On Wed, May 19, 2010 at 9:53 AM, Norman Clarke wrote:
> On Tue, May 18, 2010 at 16:47, James MacAulay wrote:
>> Small but nasty bug, tested and fixed:
>>
>> https://rails.lighthouseapp.com/projects/8994-ruby-on-r
I don't particularly care which is the default, but I think it should
be easy to pick either. Maybe a flag on the rails command like -d for
the database. You could do something like:
rails myapp -j=jquery
Allen Madsen
http://www.allenmadsen.com
On Mon, May 24, 2010 at 6:10 PM, Yehuda
I personally have never used `rake db:test:prepare`. I generally use `rake
db:migrate RAILS_ENV=test`. Something more concise is welcome.
Allen Madsen
http://www.allenmadsen.com
On Tue, Sep 21, 2010 at 12:00 PM, radhames brito wrote:
>
> nothing intrigues me more than db:test
If I understand you right, you're saying `rake db:test:prepare`
is synonymous with `rake db:schema:load RAILS_ENV=test` instead of migrate.
Allen Madsen
http://www.allenmadsen.com
On Tue, Sep 21, 2010 at 12:04 PM, Xavier Noria wrote:
> Not sure I follow.
>
> You do not need an
There may be valid reasons to not have your database on the most recent
migration. It would be difficult for rails to know when it should go to the
newest version and when it should stay at a particular one.
Allen Madsen
http://www.allenmadsen.com
On Tue, Sep 21, 2010 at 12:06 PM, Ryan Bigg
I might be wrong in understanding the problem, but I believe I would use
transactions to solve the problems you're describing. I don't see the need
to manage locks manually.
Allen Madsen
http://www.allenmadsen.com
On Sun, Oct 31, 2010 at 7:28 AM, Rodrigo Rosenfeld Rosas wrote:
&
Proposal sounds reasonable to me.
+1
Allen Madsen
http://www.allenmadsen.com
On Tue, Dec 21, 2010 at 11:17 AM, PivotalBoulderMikeG
wrote:
> Aaron,
>
> What's the best way to make some noise about this? Tell people about
> this thread?
>
> MIke
>
> On Dec 21,
+1 for URL and email validators.
Allen Madsen
http://www.allenmadsen.com
On Sat, Feb 12, 2011 at 4:19 AM, Xavier Noria wrote:
> On Fri, Feb 11, 2011 at 7:38 PM, Rodrigo Rosenfeld Rosas
> wrote:
>
> > validates_format_of :email, :with =>
> > /\A([^@\s]+)@((?:[-a-
Hey Prem,
I don't see `db:reset` in the list.
Allen Madsen
http://www.allenmadsen.com
On Fri, Mar 4, 2011 at 9:36 AM, Prem Sichanugrist wrote:
> Hi Rodrigo,
>
> I cannot reproduce your problem on latest 3.0.5. Here's my gist showing the
> test: https://gist.github.com/85
It also says, in the docs you linked to:
As a rule of thumb you can think of underscore as the inverse of camelize,
though there are cases where that does not hold:
"SSLError".underscore.camelize # => "SslError"
So the situation you're talking about is a known sho
ed
to solve.
However, since it looks like you're just trying to get this to run, you
could just uninstall the newest version of prawn and there's a good chance
things will work out. If not, you'll have to go version hunting for
compatible gems or retrofit the project to use Bundler
))
This is idiomatic ruby behavior and shouldn't be affected by rails, though I
can't say for certain it isn't.
[1]: http://www.ruby-doc.org/core/classes/Object.html#M001015
Allen Madsen
http://www.allenmadsen.com
On Mon, Jun 13, 2011 at 12:20 AM, gerberdata wrote:
> Hi not sure
Perhaps the issue is related to passing "mounable" instead of "mountable":
rails plugin new myengine --mountable
Allen Madsen
http://www.allenmadsen.com
On Thu, Jul 7, 2011 at 11:10 AM, mrloz wrote:
> Hi there.
>
> I'm having some real issues with engines an
What Rodrigo said.
+1 for jasmine
Allen Madsen
http://www.allenmadsen.com
On Wed, Aug 31, 2011 at 6:11 PM, Rodrigo Rosenfeld Rosas wrote:
> **
> When you do that, it would be similar to not adding tests on generators or
> not providing Coffeescript or SASS support in a default
I don't think it was quite as drastic as not allowed. If I remember
correctly, it was just that it wasn't picked from all the open source
projects that applied.
Allen Madsen
http://www.allenmadsen.com
On Wed, Feb 15, 2012 at 4:31 PM, Steve Klabnik wrote:
> Isn't Ruby not a
decide what
is best for their specific case. If you're on a team, set a style guide
that picks a winner.
Allen Madsen
http://www.allenmadsen.com
On Thu, May 31, 2012 at 11:05 AM, Maksym Melnychok wrote:
> On Thursday, May 31, 2012 4:50:05 PM UTC+2, Steve Klabnik wrote:
>>
>> It&
Squeel (not to be confused with Sequel) does a pretty good job of covering
the other 20%.
https://github.com/ernie/squeel
Allen Madsen
http://www.allenmadsen.com
On Mon, Jun 4, 2012 at 6:24 PM, Maurizio Casimirri
wrote:
>
> Il giorno 04/giu/2012, alle ore 23.27, Bruce Perens ha s
You'd want to move your gem out of assets if you want it to be available in
other environments on heroku.
Allen Madsen
http://www.allenmadsen.com
On Sun, Jul 15, 2012 at 8:13 AM, Rodrigo Rosenfeld Rosas wrote:
> I've released a new Engine yesterday, called oojspec:
>
>
These comments in your gemfile explain why:
https://github.com/rosenfeld/oojspec-test/blob/master/Gemfile#L10:L11
Allen Madsen
http://www.allenmadsen.com
On Sun, Jul 15, 2012 at 8:57 AM, Allen Madsen wrote:
> You'd want to move your gem out of assets if you want it to be available
&g
This pull request poses two problems in my mind. The changes are not
backwards compatible, which could lead to some serious head scratching.
Secondly, even though they're a standard now, they're not commonly used,
which leads to more head scrathing.
Allen Madsen
http://www.allenmadse
This is relevant:
http://stackoverflow.com/questions/328525/what-is-the-best-way-to-set-default-values-in-activerecord
They mention using after_initialize.
Allen Madsen
http://www.allenmadsen.com
On Thu, Oct 18, 2012 at 8:50 AM, Gabriel Sobrinho <
gabriel.sobri...@gmail.com> wrote:
>
Check out https://github.com/thoughtbot/appraisal
Allen Madsen
http://www.allenmadsen.com
On Thu, Oct 25, 2012 at 12:57 PM, Gary Weaver wrote:
> Request denied by dhh. See pull request for reasons. Sounds like
> strong_parameters is living up to its name. It won't be taken down by
At Gazelle, we essentially copy the migration rake tasks and call them
iterations. So, as you'd imagine:
rake iteration:migrate # like rake db:migrate
We use it for data only changes.
Allen Madsen
http://www.allenmadsen.com
On Thu, Feb 21, 2013 at 3:17 PM, Duncan Beevers wrote:
> O
Here's the task I alluded to if anyone is interested:
https://gist.github.com/blatyo/5047690
Allen Madsen
http://www.allenmadsen.com
On Thu, Feb 21, 2013 at 3:26 PM, Allen Madsen wrote:
> At Gazelle, we essentially copy the migration rake tasks and call them
> iterations. So, as yo
class is a global object, scopes originate from there, and
any piece of code could modify the behavior of that global, it would
introduce side effects throughout an application. Ideally, when side
effects are present, they're localized to a small scope.
Allen Madsen
http://www.allenmadsen.com
I agree. Just yesterday, I wrote a separate task that only did migrations
for deploy.
Allen Madsen
http://www.allenmadsen.com
On Fri, Jan 31, 2014 at 1:13 PM, Emil S wrote:
> Currently the `db:migrate` rake task runs `dump` at the end which dumps
> the database structure to `sch
Completely wild guess, but the issue you're seeing could be related to the
fact that you're running in development mode. I wouldn't trust any
benchmark unless the app was in production mode. One reason is the code
reloading in development mode.
Allen Madsen
http://www.allenmads
:profile, required: true
end
Hope that helps,
Allen Madsen
http://www.allenmadsen.com
On Wed, Sep 10, 2014 at 9:47 PM, Aaron Kromer wrote:
> This behavior has been around for awhile (since at least 3.2.x; I didn't
> test further back). I'm a bit surprised this didn't trip my
The best name for "x" that I can think of would be "for".
`config.for.redis.host`
Allen Madsen
http://www.allenmadsen.com
On Wed, Sep 17, 2014 at 9:22 AM, Mohamed Wael Khobalatte
wrote:
> config_for is better because it signals that you are doing non-standard
> confi
You can pass index options instead of true. For example:
```
t.references :vancancy, index: {name: :my_great_name}
```
Allen Madsen
http://www.allenmadsen.com
On Fri, Jun 12, 2015 at 11:12 AM, Egor Vorobiev
wrote:
> Hi, Folks!
>
> I wrote this.
>
You can already do this. Call create! and rescue ActiveRecord::RecordInvalid.
http://api.rubyonrails.org/classes/ActiveRecord/Persistence/ClassMethods.html#method-i-create-21
Allen Madsen
http://www.allenmadsen.com
On Wed, Feb 17, 2016 at 2:40 PM, Daniel Finlay wrote:
> I'd like to
00 million times. If you can demonstrate that the place
containing the `loop` is a hotspot that gets executed many times in a
request, then the optimization is probably justified. That's why it
wouldn't just be a find and replace for all instances.
Allen Madsen
http://www.allenmadsen.com
On
ad do:
company.do_thing
Then each subclass of company would implement the correct behavior for
that case.
For the behavior you described, you may be better served with Rails
enum support: http://api.rubyonrails.org/v4.1/classes/ActiveRecord/Enum.html
Allen Madsen
http://www.allenmadsen.com
On Fri, May 20, 2016
I believe everything under app/models is loaded by default, so you
shouldn't need to add a subdirectory.
Allen Madsen
http://www.allenmadsen.com
On Fri, Feb 24, 2017 at 10:49 AM, Maurizio De Santis <
desantis.mauri...@gmail.com> wrote:
> [From the issue I opened about it: http
42 matches
Mail list logo