Skip to content

Options pass through can pick up unintended options #34

Description

@Fjan

The gem passes through SaSS options defined in Rails, here

PASS_THRU_OPTIONS.each do |option|
  options[option] = ::Rails.application.config.sass.send(option)
end

However, because it uses send, if an option is not defined it will walk up the class hierarchy and if it happens to find an identically named method in one of its parents it will use that instead. (In our case we did not have sass.logger defined, but we did have a logger in another place and it ended up sending the wrong logger object).

I think it should be easy to fix by using [ ] instead, but perhaps there was a reason for using send?

PASS_THRU_OPTIONS.each do |option|
  options[option] = ::Rails.application.config.sass[option]
end

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions