search for: josevalim

Displaying 9 results from an estimated 9 matches for "josevalim".

2010 Nov 30
2
Did I miss a meeting?!
I''ve just stumbled (literally, while I was trying to fix a glitch I was having after upgrading Aegis...) on the Inherited Resources gem... why did no-one tell me?! ;-) Is everyone else using some form of controller base-class? Am I the last on this bus! https://github.com/josevalim/inherited_resources -- 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-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails...
2010 Jan 25
9
skinny Controllers, fat models with REST?
Hi, I''m really new to rails, so i programmed some stuff and today i read some things about skinny Controllers, fat models. My Controllers are really fat now. So i''m asking myself how can i shrink my controllers and move the code to the models, especially in fact of REST e.g. in focus on error codes? code example: # POST /tasks # POST /tasks.xml def create @authorized
2012 Sep 25
9
Any rails experts able to offer some advice?
Hello all. #1 I am working on a rails3 gem called Yarder (https://github.com/rurounijones/yarder). The goal of this gem is to replace the rails logging system with one that is JSON based rather than string based. #2 To this end I also recently asked this list about making the LogSubscribers subscriptions to ActiveRecord::Notifications configurable and am looking at submitting a patch
2012 Oct 01
1
active_model_serializers, more than one level deep of associations, specifying serializers per association
...ons, etc.''s serializers in a single serializer or at least be able to define a different serializer type in the definition of the association in the serializer. I see some mention of polymorphic in the code and this discussion of a pull request between Jose and Adam: https://github.com/josevalim/active_model_serializers/pull/24 Wondering what the best way to attack this is, and whether any of this is stuff others will run into/whether avoiding circular attributes is something that should be a serializer responsiblity other than the existing circular reference checking that happens alre...
2009 Dec 21
1
Display ActiveRecord runtime info in the view
Hi list, In Rails logs, at the end of each request, the log states something like Completed in 37ms (View: 1, DB: 8) Is there a simple way to access the "DB: 8" info in the view ? Thanks Julien -- 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
2012 Mar 07
0
LoadError: Expected X to define on gem upgrade
...oller/, '''').split(''::'') namespaced_class = [namespaced_classes.first, namespaced_classes.last].join(''::'').singularize namespaced_class.constantize rescue NameError nil end From: https://github.com/josevalim/inherited_resources/blob/master/lib/inherited_resources/class_methods.rb So I guess Rails is trying to load the model Base and is wrongly deciding that my existing base.rb file should take precedence or something, but since it''s not namespaced to just Base it raises this error. How can...
2012 Sep 28
1
How to Include Associations in #as_json
Hi, Does anyone know how to include nested associations when overriding a model''s #as_json method? Below is my attempt to include direct and nested associations. NOTE: "office" is a direct association, "company" is nested association via "office". I''d like both included in the generated json output. def as_json(options={}) super(:include
2009 Mar 19
6
[Cucumber 0.2] Failure to use should
I have a step definition like this: Then "the account should be created" do account = Account.find_by_name("my shiny new account") p account.class account.should_not be_blank end When running this step, I got the error message: Account(id: integer, name: string, state: string, next_renewal_at: date, created_at: datetime, updated_at: datetime, full_domain: string,
2012 Sep 15
10
Versioning of Views; Our Approach
My friend Ben Willis and I have developed a gem for the versioning of Rails views. https://github.com/bwillis/versioncake The versioning is done by the naming convention. Image the following series of files : show.v3.json.jbuilder show.v2.json.jbuilder show.v1.json.jbuilder create.v2.json.jbuilder create.v1.json.jbuilder The developer pre-defines all view versions in their config. When a