Closed willcosgrove closed 9 years ago
Woaaahh I did not know that cattr_accessor
actually used a class attribute. I thought its whole point was to avoid the dangers of class attributes. I wonder if I've ever actually used it anywhere!
Ok, sorry I said AssetPath
but I realize now that AssetPath
is used for the path to the bundled JS, not the path to the files to reload :S Kind of dumb of me to get those mixed up. Do you mind moving that config back to AssetChangeSet
? Sorry I got confused :weary:
No worries, yeah I thought it looked like a funny place for it. I'll move that over to AssetChangeSet
.
Do you want to stick with cattr_accessor
, or move to some other solution?
I think cattr_accessor
is fine since nobody's extending that class, but I think the safest is:
class AssetChangeSet
# ...
class << self
attr_accessor :asset_glob
end
self.asset_glob = "#{your_glob}"
end
Ohhh, maybe this is what i was thinking of: http://apidock.com/rails/Class/class_attribute ¯(ツ)/¯
Ok, how does that look? I switched to class_attribute
which basically is doing what you mentioned above. It's dependent on ActiveSupport, but since this whole gem is for Rails, I figure that's not a horrible thing.
:money_with_wings: :confetti_ball:
Shipped as 0.4.0
Sweet, thanks!
Per your recommendation on #3. Hopefully this resembles what you had in mind! If not, let me know, and I'll get it fixed.