Files
2012-02-21 01:15:00 -05:00

1 line
2.6 KiB
JSON

[{"user_id": 6140, "stars": [], "topic_id": 4888, "date_created": 1297610079.8035331, "message": "I actually like using append_features directly, but for some reason everybody uses included, even if overriding append_features would make sense.", "group_id": 109, "id": 91404}, {"user_id": 8595, "stars": [], "topic_id": 4888, "date_created": 1297611231.2143979, "message": "I always forget about append_features, which is the only reason I stick to included", "group_id": 109, "id": 91456}, {"user_id": 8891, "stars": [], "topic_id": 4888, "date_created": 1297622757.793843, "message": "According to the docs, `include` just calls `append_features` for each parameter (in reverse). Doesn't seem like there's anything to gain by favoring the less-common `append_features` directly. Am I missing something?", "group_id": 109, "id": 92808}, {"user_id": 8466, "stars": [], "topic_id": 4888, "date_created": 1297624438.7894211, "message": "`include` calls trigger `included?`", "group_id": 109, "id": 92887}, {"user_id": 6140, "stars": [], "topic_id": 4888, "date_created": 1297634471.993943, "message": "now some fancy lib might hook into included somewhere. but it should better be overriding append_features instead.", "group_id": 109, "id": 94096}, {"user_id": 1516, "stars": [], "topic_id": 4888, "date_created": 1297634844.161195, "message": "@rkh why is it \"better\" to override append_features?", "group_id": 109, "id": 94127}, {"user_id": 6140, "stars": [], "topic_id": 4888, "date_created": 1297634424.1023729, "message": "the letter is much cleaner, avoiding to circumvent the private method issue, but skips the included hook.", "group_id": 109, "id": 94090}, {"user_id": 6140, "stars": [], "topic_id": 4888, "date_created": 1297634386.1247389, "message": "@coreyward include is private, which leads to the pattern `module Extension; Base.send(:include, self); ...; end`, which can also be expressed by `module Extension; append_features Base; ...; end`", "group_id": 109, "id": 94085}, {"user_id": 6140, "stars": [], "topic_id": 4888, "date_created": 1297634447.1048441, "message": "which should generally be ok, since it's your module.", "group_id": 109, "id": 94094}, {"user_id": 6140, "stars": [], "topic_id": 4888, "date_created": 1297669084.2468629, "message": "@judofyr not always, but in my opinion it's better for stuff like `extend ClassMethods`, as you change how inclusions works rather than placing that logic in a hook maybe triggered after inclusion. also, you cannot be sure your included will be called, as ppl constantly forget to call super in included. so, if you want to change how inclusion works, define append_features, imo.", "group_id": 109, "id": 96865}]