app/models/labeling/base.rb in iqvoc-4.3.3 vs app/models/labeling/base.rb in iqvoc-4.4.0
- old
+ new
@@ -13,30 +13,29 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
class Labeling::Base < ActiveRecord::Base
-
self.table_name = 'labelings'
class_attribute :rdf_namespace, :rdf_predicate
self.rdf_namespace = nil
self.rdf_predicate = nil
# ********** Associations
- belongs_to :owner, :class_name => "Concept::Base"
- belongs_to :target, :class_name => "Label::Base"
+ belongs_to :owner, class_name: 'Concept::Base'
+ belongs_to :target, class_name: 'Label::Base'
# ********** Scopes
def self.by_concept(concept)
- where(:owner_id => concept.id)
+ where(owner_id: concept.id)
end
def self.by_label(label)
- where(:target_id => label.id)
+ where(target_id: label.id)
end
def self.concept_published
includes(:owner).merge(Concept::Base.published)
end
@@ -69,21 +68,20 @@
def self.singular?
false
end
def self.view_section(obj)
- obj.is_a?(Label::Base) ? "concepts" : "labels"
+ obj.is_a?(Label::Base) ? 'concepts' : 'labels'
end
def self.view_section_sort_key(obj)
200
end
def self.partial_name(obj)
- "partials/labeling/base"
+ 'partials/labeling/base'
end
def self.edit_partial_name(obj)
- "partials/labeling/edit_base"
+ 'partials/labeling/edit_base'
end
-
end