We have a complex legacy schema with a lot of tables and models, and I
can't keep all of the paths between tables in my head, so just wrote
something that could help find the path between any two models just by
entering their model names like:
bundle exec modelist paths my_model_1 my_model_2
w
To support what you are saying, there are newer faster versions of Ruby 2
for Windows as mentioned here:
http://www.ruby-forum.com/topic/4411307
And Rails 4 is optimized for Ruby 2.
It is also possible that if Windows is being run in a VM, that would be
slower, or perhaps the hardware it is run
ullet
On Wednesday, May 22, 2013 3:12:43 PM UTC-4, gsw wrote:
>
> Would this work?
>
> MyModel.last.serializable_hash methods: MyModel.reflections.keys
>
> Or is that too much?
>
> Look at the options that you can pass into serializable_hash.
>
> However, if you are doing
Would this work?
MyModel.last.serializable_hash methods: MyModel.reflections.keys
Or is that too much?
Look at the options that you can pass into serializable_hash.
However, if you are doing this for json/etc. serialization in the
controller, check out ActiveModel::Serializers.
On Wednesday,
On Thursday, May 2, 2013 5:19:17 AM UTC-4, Bigos wrote:
>
> I hate Rails sometimes. Now and then I have a feeling that using Rails is
> like trying to fit a square peg in a round hole. For example Active record
> doesn't fit my every need and sometimes I have to use SQL. Because I use
> Rails I
Hey,
We've been using this for a while in production and just made some security
fixes today and added it to Rubygems:
https://github.com/rubyservices/restful_json
Just:
gem 'restful_json'
and follow the directions in the README (it GitHub link above). It should
work with Rails 3.1+ and 4+ (
://github.com/garysweaver/autolog
On Thursday, October 18, 2012 3:51:01 PM UTC-4, gsw wrote:
>
> Gem changed a lot from yesterday. It's a little more like Tracer now:
> https://github.com/garysweaver/autolog
>
> On Wednesday, October 17, 2012 2:32:47 PM UTC-4, gsw wrote:
>
Posted on stackoverflow but no traction yet:
http://stackoverflow.com/questions/12942505/why-does-using-set-trace-func-work-in-some-places-but-cause-unexpected-return-l
The following is a generified part of the code in a gem I'm working on:
module SomeModule
class << self
attr_a
Gem changed a lot from yesterday. It's a little more like Tracer now:
https://github.com/garysweaver/autolog
On Wednesday, October 17, 2012 2:32:47 PM UTC-4, gsw wrote:
>
> If it helps anyone developing Rails apps or gems, I wrote a shortcut for
> set_trace_func, so next time yo
If it helps anyone developing Rails apps or gems, I wrote a shortcut for
set_trace_func, so next time you want to just add a line before and after
some function you are trying to debug you can have Ruby temporarily output
every line, method, etc. executed. Also, it lets you define the format, us
mmunity that
> are worth a look.
>
> I'm coming from a ColdFusion background and enjoy reading blogs like
> Raymond Camden's and Ben Nadal's where they regularly posts how too's and
> ask Ray/Ben type things.
>
> Thanks, Richard
>
>
> On Friday, 5 O
Yes, and that will be the same for railscasts, peepcode, and everything
else. Things change quickly. But agree- I used to work somewhere that had
access to Lynda and when I checked it their stuff was older, but like
anything, maybe they have new content by the time you read this.
On Friday, Oct
Online there is:
http://guides.rubyonrails.org/
http://railscasts.com/ (but many not free, but worth it)
https://peepcode.com/ (not free, but worth it)
Most of what you run into you'll be able to google but note that things
changed significantly from Rails 2 to 3 (and a lot between 3 and 3.1), a
What is the error you are getting? You'd be better off leaving json in
there.
If you are looking for something more lightweight, have you also looked at
Sinatra, etc.? http://www.sinatrarb.com/
On Tuesday, October 2, 2012 8:01:27 AM UTC-4, roelof wrote:
>
> Nobody who can tell me ?
>
> Op maand
Something else to consider is whether you are running the config that you
assume that you are.
Trying putting an echo into the startup script that contains the RVM setup,
like "getting ready to load RVM...", then look into what shell you are
using, which script is being used depending on whethe
to_json and as_json are not what you are probably looking for.
If you are using a decently up-to-date version of Rails, look at:
https://github.com/josevalim/active_model_serializers
That is what is going to be used in Rails 4.
If you want Hypermedia (links to resources, etc.), HAL support, etc
;bar'
puts "self.class.foobar=#{self.class.foobar}"
end
def index
puts 'index called'
end
end
end
On Friday, September 28, 2012 11:03:02 AM UTC-4, gsw wrote:
>
> I have some class attributes that I'm setting in an ActiveSupport::Concer
I have some class attributes that I'm setting in an ActiveSupport::Concern
and would like to hook into class_attribute setters, but is really isn't
acting like I would assume.
Here's what I did to test. I didn't create a different controller, because
just wanted to try to do as little as possib
t; 'value'}
def self.time; Time.now; end
end
Posted here with more examples:
http://stufftohelpyouout.blogspot.com/2012/09/forget-struct-and-openstruct-flexible.html
On Sunday, September 23, 2012 11:56:49 AM UTC-4, gsw wrote:
>
> On Sunday, September 23, 2012 8:11:43 AM UTC-4, I
On Sunday, September 23, 2012 8:11:43 AM UTC-4, Ilia Bylich wrote:
>
> I am not sure that this way is simple. I usually use for gem configuration
> this code
>
> require 'active_support/configurable'
> module GemModule
> include ActiveSupport::Configurable
>
> class << self
> def setup
>
Just did this in my constance gem, and totally love it as a way to add
configuration or options configurability to your gem:
http://stufftohelpyouout.blogspot.com/2012/09/forget-struct-and-openstruct-flexible.html
like:
module MyModule
class << self
attr_accessor :debug, :proc, :some_mappi
On Tuesday, September 18, 2012 12:28:00 PM UTC-4, gsw wrote:
>
> # I have not tested this- just a possibility of something that would use
> roar-rails which provides consume! and deserialization.
> def create
> # another method to implement that relies on proper authori
On Tuesday, September 18, 2012 12:28:00 PM UTC-4, gsw wrote:
>
> respond_with(errors: [@company.errors], location: users_url,
> status: unprocessable_entity)
>
>
Sorry, a lot of status symbols missing the preceding colon. Also, I think
the location only needs to be set
On Tuesday, September 18, 2012 12:28:00 PM UTC-4, gsw wrote:
> respond_with(errors: [@company.errors], location: users_url,
> status: unprocessable_entity)
>
>
Ugh. Didn't need the array around @company.errors either.
respond_with(errors: @company.errors, lo
On Tuesday, September 18, 2012 12:28:00 PM UTC-4, gsw wrote:
> rescue
> puts $!.inspect, $@
> # TODO: add support for other formats
> respond_to do |format|
> format.json { render json: {errors: [$!.message]}, status:
> (:internal_server_er
I've been writing a gem to implement and extend common controller
functionality so that Rails can be used with Javascript frameworks like
AngularJS (which we are using), Ember.js, etc. in such a way that the user
doesn't have to tweak a a bunch of rails g controller boilerplate code to
provide
Was just reminded that when select foobars_seq.nextval id from dual is
called it should increment sequence number, and it does this even
within transaction without rollback of the sequence number, so in
theory it should not be reusing the same id gotten from the sequence
since there should be no wa
Have an app using an old version of Rails (2.3.2). There are a handful
of servers running the application (and other applications) in
passenger. When a model is added at the same time on two servers,
sometimes one model that was just added by a user on the first server
causes another comment being
Have an app using older version of Rails (2.3.2) that I need some
routing assistance with if anyone has a minute.
The app was originally designed to be purely html view, and an xml and
json api was hacked on. To keep it clean, we are now moving the first
version of the api (v1) under its own direc
29 matches
Mail list logo