Every repository with this icon (
Every repository with this icon (
| Description: | Inherited Resources speeds up development by making your controllers inherit all restful actions so you just have to focus on what is important. edit |
-
Create hook to allow everyone to create *_resource_url
0 comments Created 6 months ago by josevalimComments
-
begin_of_association_chain : A small issue, but it's bugging me.
3 comments Created 2 months ago by paulcaShoot me down if I'm being pedantic, but this is Ruby!
I'm wondering if there's any reason for naming "begin_of_association_chain" as such ... it's not correct English, and I feel it sticks out in an otherwise very solid implementation.
I'd hazard that it should be 'beginning_of_association_chain" or "start_of_association_chain"
What do you think? Is this too anal?
Paul
Comments
My bad! :P
Of course it has low priority, but I will change for end_of_association_chain when I have some time! ;)
begin_association_chain, end_association_chain would make sense in Ruby. It's the "ofs" that make it awkward. An alias of start_of_assocation_chain would also make sense.
@dan Agreed, but I think "begin_association_chain" changes the meaning sufficiently to hide the intent ... specifically that this is the first item in the association chain. I think it's just a coincidence that 'end' is a verb and 'beginning' isn't!
to me 'beginning_of_association_chain' is more expressive than 'start_of_assocation_chain' ....
@jose I think it would be wise to alias it as Dan suggests, or at least deprecate for a point release!
-
Move parent, parent_type and parent_class helpers to belong_to
0 comments Created 2 months ago by josevalimAnd allow parent to be created using association_chain.
Comments
-
Update Responder to contain latest Rails Edge changes
0 comments Created 22 days ago by josevalimComments
-
Running into bug using inherited_resources with DataMapper
1 comment Created 21 days ago by bnoguchiI am trying out inherited_resources with DataMapper. I found that mimes_for_respond_to resolves to nil. Based on my debugging, I think this is because inherited_resources assumes developers are using the class inheritable attribute methods from ActiveSupport, while DataMapper provides a subset of those methods with a different implementation using the Extlib gem. This results in data being stored using ActiveSupport's write_inheritable_attribute method, but that data can't be accessed because inherited_resources ends up using Extlib's class_inheritable_reader, resulting in mimes_for_respond_to resolving to nil. Not sure how to do a work-around gracefully without messing up other libs that depend on DataMapper's Extlib and ActiveSupport.
Comments
jeroenvandijk
Wed Dec 02 01:47:02 -0800 2009
| link
I can confirm InheritedResources (0.9.3) is not working with Datamapper (10.1)
I have quickly tried to redefine the write_inheritable_attribute method, but that didn't work.
-
I have a resource that has some accessors created within an after_initialize method...
class Project < ActiveRecord::Base def after_initialize # create method... end ...In the controller I have the "new" action automatically created with inherited resources. However, the resource is nil when it hits the "after_initialize". However, if I explicitly add the new method, everyone works fine...
def new @project = end_of_association_chain.new endShouldn't the resource being automatically created with inherited resources also be using end_of_association_chain.new?
BTW - I do have :new listed as an action in the controller, and inherited resources works splendidly almost everywhere
Best regards,
David BaldwinComments
Yeah, that definitely should work. Can you please add a failing test case?
carlosantoniodasilva
Wed Dec 09 02:36:56 -0800 2009
| link
Are you using after_initialize inside private declaration in your model? after_initialize only works if its protected/public.
-
There are some problem areas where exceptions are being silently discarded only to lead to errors further on that are hard to track down.
E.g. class_methods.rb:306 gets the resource class but rescues and returns nil if my model definition has an error, leading to an exception in the IR code later on when it calls find on nil.
There are also "rescue nil" lines in the controller methods that have caused me problems.
Will fork and try to patch in Jan, but if there are any particular reasons for these or no one else experiences this I'd be interested in hearing about it.
Thanks!
Comments











