Merge branch 'master' into notes
Conflicts: Gemfile Gemfile.lock app/assets/stylesheets/common.css.scss app/helpers/application_helper.rb
This commit is contained in:
commit
7599f98957
133 changed files with 4192 additions and 1690 deletions
9
config/initializers/active_record.rb
Normal file
9
config/initializers/active_record.rb
Normal file
|
@ -0,0 +1,9 @@
|
|||
# We need to restore field_changed? support until CPK is updated
|
||||
module ActiveRecord
|
||||
module AttributeMethods
|
||||
module Dirty
|
||||
private
|
||||
alias_method :field_changed?, :_field_changed?
|
||||
end
|
||||
end
|
||||
end
|
14
config/initializers/cors.rb
Normal file
14
config/initializers/cors.rb
Normal file
|
@ -0,0 +1,14 @@
|
|||
require "rack/cors"
|
||||
|
||||
# Allow any and all cross-origin requests to the API. Allow any origin, and
|
||||
# any headers. Non-browser requests do not have origin or header restrictions,
|
||||
# so browser-requests should be similarly permitted. (Though the API does not
|
||||
# require any custom headers, Ajax frameworks may automatically add headers
|
||||
# such as X-Requested-By to requests.)
|
||||
Rails.configuration.middleware.use Rack::Cors do
|
||||
allow do
|
||||
origins "*"
|
||||
resource "/oauth/*", :headers => :any, :methods => [:get, :post]
|
||||
resource "/api/*", :headers => :any, :methods => [:get, :post, :put, :delete]
|
||||
end
|
||||
end
|
21
config/initializers/r2.rb
Normal file
21
config/initializers/r2.rb
Normal file
|
@ -0,0 +1,21 @@
|
|||
class R2Template < Tilt::Template
|
||||
self.default_mime_type = 'text/css'
|
||||
|
||||
def self.engine_initialized?
|
||||
defined? ::R2
|
||||
end
|
||||
|
||||
def initialize_engine
|
||||
require_template_library "r2"
|
||||
end
|
||||
|
||||
def prepare
|
||||
@output = R2.r2(data)
|
||||
end
|
||||
|
||||
def evaluate(scope, locals, &block)
|
||||
@output
|
||||
end
|
||||
end
|
||||
|
||||
Rails.application.assets.register_engine ".r2", R2Template
|
Loading…
Add table
Add a link
Reference in a new issue