Skip to content

Instantly share code, notes, and snippets.

@gouravtiwari
Created September 29, 2013 16:00
Show Gist options
  • Select an option

  • Save gouravtiwari/6753758 to your computer and use it in GitHub Desktop.

Select an option

Save gouravtiwari/6753758 to your computer and use it in GitHub Desktop.
Fix for mass assignment for rails engine gem to work on rails-3 and rails-4 both
# If it is Rails-3 then using attar_accessible in model:
def self.needs_attr_accessible?
Rails::VERSION::MAJOR == 3
end
if needs_attr_accessible?
attr_accessible :list_of_attributes
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment